i have a combobox i want to show all the student name in it , i am using mssql database , and when we select student a textbox will show the rollno of that student , please help me
Jump to Post
try this code , hope this will solve your prob.
Sub values() Dim con As New SqlConnection("connectionstring") con.Open() Dim da As New SqlDataAdapter("select name , idno from students", con) Dim dt As New DataTable da.Fill(dt) ComboBox1.DataSource = dt ComboBox1.DisplayMember = "name" ComboBox1.ValueMember = "idno" End …
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.