Rajavel G

Rajavel G

  • NA
  • 95
  • 44.2k

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

Nov 18 2016 4:45 AM
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)