原链接:http://www.cnblogs.com/xiaolongzhang/articles/1340179.html
今天我们谈谈,TextBox控件数据绑定,很多人肯定学习过数据绑定,首先创建一个winForm项目,然后我们谈谈今天需要了解东西,做一个数据导航上一条,下一条,首条,尾条,都会想到用基本的ADO.Net来实现,这种方式不是做不出来,性能上面肯定有问题,我这此要说的一个类就用这个BindingManagerBase类实现.
接下来我们来看看代码
1
using System;
2
using System.Drawing;
3
using System.Collections;
4
using System.ComponentModel;
5
using System.Windows.Forms;
6
using System.Data;
7
using System.Data.SqlClient;
8
private SqlDataAdapter ad;
9
private DataSet ds;
10
private BindingManagerBase bManager;//用于数据导航
11
private System.Windows.Forms.Button btnFirst;
12
private System.Windows.Forms.Button btnLast;
13
private System.Windows.Forms.Button btnUp;
14
private System.Windows.Forms.Button btnDown;
15
private System.Windows.Forms.TextBox txtUserID;
16
private System.Windows.Forms.TextBox txtUserName;
17
private void Form1_Load(object sender, System.EventArgs e)
18
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18