VBNET数据库编程基础教程(12)
发布时间:2021-06-07
发布时间:2021-06-07
'把Dataset绑定student数据表
myCommand.Fill(myDataSet, ″student″)
'关闭此OleDbConnection
myConn.Close()
End Sub
'初始化窗体中的组件
Private Sub InitializeComponent()
……(省略部分自动生成代码)
End Sub
'将各个文本框控件绑定到数据库的各个字段。
Private Sub Button1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Button1.Click
TxtStuID.DataBindings.Add(New Binding(″Text″, Me.myDataSet, ″student.StuID″))
TxtStuName.DataBindings.Add(New Binding(″Text″, Me.myDataSet, ″student.StuName″))
TxtStuSex.DataBindings.Add(New Binding(″Text″, Me.myDataSet, ″student.StuSex″))
TxtStuBorn.DataBindings.Add(New Binding(″Text″, Me.myDataSet, ″student.StuBorn″))
TxtStuCore.DataBindings.Add(New Binding(″Text″, Me.myDataSet, ″student.StuCore″))
End Sub
End Class
Module Module1
Sub Main()
上一篇:国内养老地产发展模式研究