هذا الكود تستطيع استعماله لاظهار المعلومات من قاعدة البيانات في ListBox
أرجو أن يكون واضحا.
[ALIGN=LEFT]Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim thedata As DataSet
Dim theAdapter As OleDb.OleDbDataAdapter
Dim connectstring, sqlstr As String
connectstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsAdministratorMy Documentsstudent.mdb"
sqlstr = "Select * from Student"
thedata = New DataSet()
Dim Student As DataTable = thedata.Tables.Add("Student")
Dim Studentname as datacolumn= student.columns.add("studentname")
theAdapter = New OleDb.OleDbDataAdapter(sqlstr, connectstring)
theAdapter.Fill(thedata, "Student")
ListBox1.DataSource = thedata.Tables("Student")
ListBox1.DisplayMember = "Studentname"
End Sub[/ALIGN]