- 44
- 0
- 约9.12千字
- 约 44页
- 2017-04-02 发布于江苏
- 举报
项目简历系统数据库应用
3. TextBox与Label控件的数据绑定 此类控件的数据绑定的方法是把要获取的数据显示在 “Text”属性中。通常使用以下两种代码编写方法实现数据 绑定: (1)使用数据集中表的字段直接绑定,如下面的代码: label1.DataBindings.Add(Text, dataset.Tables[0], stuid); textBox1.DataBindings.Add(Text, dataset.Tables[0], stuname); 6.1.3 数据绑定 (2)使用BindingSource类型的对象实现数据绑定,如 下面的代码: BindingSource bindingsource = new BindingSource(); bindingsource.DataSource = dataset.Tables[student]; label1.DataBindings.Add(Text, bindingsource, stuid); textBox1.DataBindings.Add(“Text”, bindingsource, “stuname); 6.1.
原创力文档

文档评论(0)