Search This Blog

Tuesday, July 26, 2011

populate a text box from table data on dropbox change

Hi I want to populate a text box from a stored table I have this for the data


With DropDownList1

.DataSource = ds.Tables(“property”)

.DisplayMember = “propRef”

.ValueMember = “propRef”

.SelectedIndex = 0

End With


“property” holds all the info from the db when the user changes the dropdown list I want a text box to display additional info





 Dim connString As String = "Data Source=*****;Initial Catalog=****;Integrated Security=True"
Dim conn As New SqlConnection(connString)

Dim strSQL As String = "SELECT * FROM property WHERE (availible=1)"
Dim da As New SqlDataAdapter(strSQL, conn)
Dim ds As New DataSet
da.Fill(ds, "property")

With DownList1
.DataSource = ds.Tables("property")
.DisplayMember = "propRef"
.ValueMember = "propRef"
.SelectedIndex = 0
End With




the additional columns I want to display are flatNo, houseNo and street


So something like this on the dropdown list change

.DataSource = ds.Tables(“property”)





  If (Not Me.RadDropDownList1.SelectedValue Is Nothing) Then
Me.TextBox12.Text = "flatNo "+" houseNo "+" street"
End If




anyone have an idea how I can get this to work


thanks


M

http://bit.ly/nLf6Do

No comments:

Post a Comment