hi to all im new here, i have some difficulty in displaying records from database to my combobox here is my code in the form_load
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim con As New SqlConnection
con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\lito\Documents\QMP_DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
con.Open()
Dim da As New SqlDataAdapter("select * from Subject_Info", con)
Dim ds As New DataSet
da.Fill(ds, "subjectInfo")
Dim dt As DataTable
dt = ds.Tables("Subject_Info")
Dim dr As DataRow
Dim i As Integer
For i = 0 To dt.Rows.Count
dr = dt.Rows(i)
cbSubj.Items.Add(dr(1).ToString)
Next
end sub
can anyone please help...this is my project....