I'm a complete noob when it comes to .Net. I'm working on my college project.
In my application there's a combobox/drop-down list. My requirement is as soon as user starts typing inside it, i.e. when text_changed is triggered it should retrieve values starting from that letter from a column in the linked table. This should happend dynamically i.e. for different initial letters entries will be different so their index value should also be different each type.
I tried to write a code for very basic and statically populating entries but I'm not able to get it to work, will anyone please me?
Here's my code,
Private Sub ComboBox6_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox6.SelectedIndexChanged Dim sqlConn As SqlConnection Dim sqlCmd As SqlCommand Dim sqlDA As SqlDataAdapter 'Dim sqlDS As SqlDataReader Dim ds As DataSet sqlConn = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=""F:\Swapnil\Documents\VS2010 Projects\Apex2\Apex2\Apex.mdf"";Integrated Security=True;Connect Timeout=30;User Instance=True") sqlCmd = New SqlCommand("select * from CustomerCode", sqlConn) sqlDA = New SqlDataAdapter(sqlCmd) ds = New DataSet() sqlDA.Fill(ds) ComboBox6.Text = ds.Tables(0).Columns.ToString ComboBox6.ValueMember = ds.Tables(0).Columns.ToString ComboBox6.DataSource = ds.Tables