TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
DaMetroMan
NA
4
0
Two Dropdown lists
Dec 2 2003 5:03 AM
Does anyone have a working eg in C# of one dropdown list being populated by the selection of the first. i.e. I need to populate the second dropdown with data related to what is chosen in the first one. Here's the code I use for the second dropdown: /**************************************************************************** String MyQuery = "SELECT DivisionDesc, DivisionNo FROM Divisions Where CompanyNo = " + (Int32.Parse(ddfirstList.SelectedItem.Value)-1); SqlDataAdapter MyCommand_Priot = new SqlDataAdapter(MyQuery, sqlConnection1); DataSet DS_Priot = new DataSet(); MyCommand_Priot.Fill(DS_Priot, "Divisions"); DataRowView ViewRow = DS_Priot.Tables["Divisions"].DefaultView[0]; ddSecondList.DataSource = DS_Priot.Tables["Divisions"].DefaultView; ddSecondList.DataTextField = "DivisionDesc"; ddSecondList.DataValueField = "DivisionNo"; ddSecondList.DataBind(); ****************************************************************************/ Every time I run it it comes back blank... Please show me what I'm overlooking. Thanks. Leon
Reply
Answers (
3
)
Please tell me what this means...
DataGrid with gridTableStyle: how to retrieve data