2
Answers

I want bind data from sql db into combo box in vb??

Rajavel G

Rajavel G

7y
199
1
SQL = "select Student_branch from Student_personal_schooling"
execComDB(SQL)
adapter.SelectCommand = cmd
Dim dt As New DataTable
adapter.Fill(dt)
For Each dr As DataRow In dt.Rows
cmbbranch.Items.Add(dr("Rollno"))
Next
cmbbranch.ValueMember = "Student_branch"
cmbbranch.DisplayMember = "Student_branch"
cmbbranch.DataSource = dt
 
i tried this code but no working.. 

Answers (2)