943,981 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 310
  • VB.NET RSS
Jul 4th, 2009
0

dropdown

Expand Post »
i have a problem in dropdown :suppose i select id from dropdown then i want name of the employee is displayed matched with that id is displayed in textbox : i have use the following code

con = New SqlConnection(constr)
adpt = New SqlDataAdapter("select * from reg where f_name='" + DropDownList1.SelectedItem.Text.ToString + "' ", con)
ds = New DataSet
adpt.Fill(ds)
If ds.Tables(0).Rows.Count - 1 >= 0 Then
TextBox1.Text = ds.Tables(0).Rows(0).Item(11)
End If
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
arunasingh is offline Offline
39 posts
since Dec 2008
Jul 4th, 2009
0

Re: dropdown

arunasingh,

This is your 38th post and you post source code without bb code tags. I think you haven't read - How to use bb code tags?.

Wrap up source code with bb code tags.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008
Jul 5th, 2009
0

Re: dropdown

the logic u r using is incorrect.
use a looping statement.
traverse each record of the data set using this loop.
inside the loop check for the matching id.
when its found u display that information in the text box and then u break out of the loop
Reputation Points: -1
Solved Threads: 23
Posting Whiz in Training
babbu is offline Offline
207 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Thread.suspend and thread.resume is obsolete
Next Thread in VB.NET Forum Timeline: help me out





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC