如圖:無法移到下一條記錄,但是卻可以移到最後一條記錄,哪位大神解答一下,鄙人在此謝過。
代碼如下:
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ClassDB;
namespace HPCIMTS_admin
public partial class frmPatienttracking : Form
{
DataSet vw_病人查詢;
public frmPatienttracking()
{
InitializeComponent();
}
private void frmPatienttracking_Load(object sender, EventArgs e)
{
ClassDB.ClassDB db = new ClassDB.ClassDB();
string strSql = "select*from vw_病人查詢";
vw_病人查詢 = db.getDataSet(strSql);
bindingSource1.DataSource = vw_病人查詢.Tables[0];
bindingNavigator1.BindingSource = bindingSource1;
txt_Pno.DataBindings.Add("Text",bindingSource1,"病案號");
}
private void bindingNavigatorMovePreviousItem_Click(object sender, EventArgs e)
{
bindingSource1.MovePrevious();
}
private void bindingNavigatorMoveNextItem_Click(object sender, EventArgs e)
{
bindingSource1.MoveFirst();
}
private void bindingNavigatorMoveFirstItem_Click(object sender, EventArgs e)
{
bindingSource1.MoveFirst();
}
private void bindingNavigatorMoveLastItem_Click(object sender, EventArgs e)
{
bindingSource1.MoveLast();
}
}
}
自己已經把問題解決,不過還是要謝謝回答我問題的人。