Hey i am also facing the same problem.
I have tried this but this is not working.
please help me.
Protected Sub cmbParty_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbParty.SelectedIndexChanged
myConnection.Open()
Adpt = New SqlDataAdapter("SELECT * FROM PartyMaster where Id = '" & cmbParty.SelectedIndex & "'", myConnection)
Adpt.Fill(ExDs)
For Each row In ExDs.Tables(0).Rows
cmbParty.Items.Add(row(0))
Next
myConnection.Close()
'cmbParty.Items.Add("All")
If ExDs.HasErrors Then
lblMessage.Text = "Error while fetching Data."
Else
Here i need to take the data from exds to text boxes. As when we click on combobox we need to show data according to that party in all text box's.
txtParty.Text = command("PartyName")
txtParty.Text = partyName(cmbParty.Items.IndexOf(cmbParty.Text))
End If
Please help me.
send details ....
Hi,
Write This Code In Lost_Focus event of ComboBox:(Conn-> Connection object)DIm RST As New ADODB.RecordSet
Dim sSQL As StringsSQL = "Select * From MyTable Where RollNo = " & Val(Combo1.Text)
RST.Open sSQL, Conn
If Not RSt.EOF Then
txtName.Text = RST("Name")
txtAdd.Text = RST("Addr")
txtAge.Text = RST("Age")
Else
txtName.Text = ""
txtAdd.Text = ""
txtAge.Text = ""
End If
RST.Close
Set RST=NothingREgards
Veena