I know how to bind data to a dropdown, but how can I bind to a textbox when it doesn't have the datasource property?
This is what I havae so far:
Based on user's selection from dropdown I need to populate the textbox.
Any help would be greatly appreciated.
Thanks,
Ninel
This is what I havae so far:
Code:
Private Sub ddlEmployee_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlEmployee.SelectedIndexChanged
sAgentId = ddlEmployee.SelectedValue
If sAgentId = "0" Then
lblResult.Text = "Please Select an Employee"
Else
Call PopulateDDLs(sAgentId)
End If
End Sub
Sub PopulateDDLs(ByVal sAgentId As String)
sSQLPayRollId = " SELECT iPayrollid FROM dbo.EmEmployee WHERE sAgentid= "" & ddlEmployee.SelectedValue & """
sConn = System.Configuration.ConfigurationSettings.AppSettings.Item("connString")
oConn = New SqlConnection(sConn)
oConn.Open()
oComm = New SqlCommand(sSQLReport, oConn)
oReader = oComm.ExecuteReader()
????--- txtPayId.datasource = oReader ---??????
End Sub
Based on user's selection from dropdown I need to populate the textbox.
Any help would be greatly appreciated.
Thanks,
Ninel