.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 13th, 2002, 07:16 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
How do I move to a certain value in a dropdown list?

<i><b>Originally posted by : chris parisi (chrisp@usolcomm.com)</b></i><br />I am filling a dropdown list by binding it to a datareader. I then need to be able to move to the specific record in the dropdown. Please help.<br />

Reply With Quote
  #2  
Old March 13th, 2002, 11:21 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<i><b>Originally posted by : Srinivas</b></i><br /><br />Try datagrid and bind it with your table by<br />passing a parameter as the current value of the<br />dropdown.<br /><br />String selectCmd = "select * from Authors where state = @State";<br /><br /> SqlConnection myConnection = new SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connec tion=yes");<br /> SqlDataAdapter myCommand = new SqlDataAdapter(selectCmd, myConnection);<br /><br /> myCommand.SelectCommand.Parameters.Add(new SqlParameter("@State", SqlDbType.NVarChar, 2));<br /> myCommand.SelectCommand.Parameters["@State"].Value = MySelect.Value;<br /><br /> DataSet ds = new DataSet();<br /> myCommand.Fill(ds, "Authors");<br /><br /> MyDataGrid.DataSource= ds.Tables["Authors"].DefaultView;<br /> MyDataGrid.DataBind();<br /><br /><br /><br />------------<br />chris parisi at 3/13/2002 4:16:18 PM<br /><br />I am filling a dropdown list by binding it to a datareader. I then need to be able to move to the specific record in the dropdown. Please help.<br />

Reply With Quote
  #3  
Old March 14th, 2002, 01:24 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<i><b>Originally posted by : chris parisi (chrisp@usolcomm.com)</b></i><br />Thank you very much for your reply, but maybe you misunderstood me. I am binding a dropdown list to a datareader. Once I have the dropdown filled, I need to move to a specific value in the dropdown list depending on what the user selected on the page before. <br /><br />Any ideas?<br /><br />------------<br />Srinivas at 3/13/2002 8:21:43 PM<br /><br /><br />Try datagrid and bind it with your table by<br />passing a parameter as the current value of the<br />dropdown.<br /><br />String selectCmd = "select * from Authors where state = @State";<br /><br /> SqlConnection myConnection = new SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connec tion=yes");<br /> SqlDataAdapter myCommand = new SqlDataAdapter(selectCmd, myConnection);<br /><br /> myCommand.SelectCommand.Parameters.Add(new SqlParameter("@State", SqlDbType.NVarChar, 2));<br /> myCommand.SelectCommand.Parameters["@State"].Value = MySelect.Value;<br /><br /> DataSet ds = new DataSet();<br /> myCommand.Fill(ds, "Authors");<br /><br /> MyDataGrid.DataSource= ds.Tables["Authors"].DefaultView;<br /> MyDataGrid.DataBind();<br /><br /><br /><br />------------<br />chris parisi at 3/13/2002 4:16:18 PM<br /><br />I am filling a dropdown list by binding it to a datareader. I then need to be able to move to the specific record in the dropdown. Please help.<br />

Reply With Quote
  #4  
Old March 15th, 2002, 07:35 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<i><b>Originally posted by : Ally</b></i><br />dim li as listitem<br />For Each li In cboProviderSkillType.Items<br /> li.Selected = "FALSE"<br /> If li.Value = ValueFromPreviousPage Then<br /> li.Selected = "TRUE"<br /> End If<br />Next<br /><br /><br />------------<br />chris parisi at 3/14/2002 10:24:38 AM<br /><br />Thank you very much for your reply, but maybe you misunderstood me. I am binding a dropdown list to a datareader. Once I have the dropdown filled, I need to move to a specific value in the dropdown list depending on what the user selected on the page before. <br /><br />Any ideas?<br /><br />------------<br />Srinivas at 3/13/2002 8:21:43 PM<br /><br /><br />Try datagrid and bind it with your table by<br />passing a parameter as the current value of the<br />dropdown.<br /><br />String selectCmd = "select * from Authors where state = @State";<br /><br /> SqlConnection myConnection = new SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connec tion=yes");<br /> SqlDataAdapter myCommand = new SqlDataAdapter(selectCmd, myConnection);<br /><br /> myCommand.SelectCommand.Parameters.Add(new SqlParameter("@State", SqlDbType.NVarChar, 2));<br /> myCommand.SelectCommand.Parameters["@State"].Value = MySelect.Value;<br /><br /> DataSet ds = new DataSet();<br /> myCommand.Fill(ds, "Authors");<br /><br /> MyDataGrid.DataSource= ds.Tables["Authors"].DefaultView;<br /> MyDataGrid.DataBind();<br /><br /><br /><br />------------<br />chris parisi at 3/13/2002 4:16:18 PM<br /><br />I am filling a dropdown list by binding it to a datareader. I then need to be able to move to the specific record in the dropdown. Please help.<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > How do I move to a certain value in a dropdown list?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT