|
发表于 2020-4-18 23:45:02
|
显示全部楼层
'先取access库到dataset
dim olecon as New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\Students.mdb;User Id=admin;Password=;")
olecon.Open()
dim oleadp As OleDb.OleDbDataAdapter
dim ds as new dataset
oleadp = New OleDb.OleDbDataAdapter("select * from student where id=1", olecon)
oleadp.Fill(ds, "student")
'设置绑定即可
textbox1.DataBindings.Add(New Binding("Text", ds, "student.name"))
|
|