dropdown

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 39
Reputation: arunasingh is an unknown quantity at this point 
Solved Threads: 0
arunasingh arunasingh is offline Offline
Light Poster

dropdown

 
0
  #1
Jul 4th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,552
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 451
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: dropdown

 
0
  #2
Jul 4th, 2009
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.
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 132
Reputation: babbu has a little shameless behaviour in the past 
Solved Threads: 13
babbu babbu is offline Offline
Junior Poster

Re: dropdown

 
0
  #3
Jul 5th, 2009
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC