If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > bind data in text field based on combo box selection

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-10-09, 09:39
milenam milenam is offline
Registered User
 
Join Date: Jan 2009
Posts: 9
bind data in text field based on combo box selection

Hi guys ,

I have a vb.net form .I have a combo box on it and a text box as well.
I populated the combo box values(CedantID)directly from table in my database with sql query.
Now I want to display in a a text box or maybe in a second combo box , only the corresponding CompanyType whichi is in the same table.
I tried to do that in ComboBox1 - Selected Value Changed in the same manner with sql query but it does say that DataSet is not belonging to text box
Here is my code behind :

Public Class Form1

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim conn As New System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;Data Source=C:\DataStatusRecord1.mdb")
Dim strSQL As String = "SELECT distinct CedantID FROM Recording"
Dim da As New System.Data.OleDb.OleDbDataAdapter(strSQL, conn)
Dim ds As New DataSet
da.Fill(ds, "Cedantid")
With Me.ComboBox1
.DataSource = ds.Tables("CedantID")
.DisplayMember = "CedantID"
.SelectedIndex = 0

End With

End Sub


Private Sub ComboBox1_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedValueChanged

I don`t know what exactly should go in here

End Sub
End Class
Thanks in advance
Milena
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On