Vishal Rane
New member
Suppose der is one database name Customer which have columns like Cust_ID,Cust_Name,Cust_Mob,Cust_Address
And on Form der are one list box which contains all Cust_Id from database
and 4 textbox
so when user click on the listbox having id as 1 it should display name, mob and address of cust_id 1 in 4 textbox respectively pls help me asap........
This is what i have done so far
Thanks in advance....
And on Form der are one list box which contains all Cust_Id from database
and 4 textbox
so when user click on the listbox having id as 1 it should display name, mob and address of cust_id 1 in 4 textbox respectively pls help me asap........
This is what i have done so far
- Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
- dbSource = "Data Source=xx-B4C521B850\SQLEXPRESS;Initial Catalog=TT;Integrated Security=True"
- con.ConnectionString = dbSource
- con.Open()
- sql = "Select Cust_Fn from Cust where Cust_Id='" & ListBox1.Text & "' "
- da = New SqlClient.SqlDataAdapter(sql, con)
- da.Fill(ds, "Cust")
- con.Close()
- TextBox1.Text = ds.Tables("Cust").Rows(0).Item(0)
- End Sub'
Thanks in advance....