菜鸟问题 关于textbox lable之类控件跟数据库绑定的问题
比如 假设有个ACCESS数据库students.mdl 其中有个表 student 然后表里有id,name...现在有个textbox1里面想显示student表里的name,比如where id=1
谢谢各位啦 --------------------编程问答-------------------- '先取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"))
--------------------编程问答-------------------- 没有机会了
补充:.NET技术 , VB.NET