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
ToBe
NA
164
94.4k
Related DropDownlists
May 26 2013 4:45 AM
Hi
I have 3 related Dropdownlist in me Edit Form
I'm using the code below to bind the Dropdownlist but it will retrive the full list without the selected value saved and if i'm making a selected statment it will just retrive the selected value.
the dropdownlist is linked to other one so if the Category been saved as "Art" the Subject should retrive the saved Item the user selected earlier with the rest items for update purpose .
private void BindDrp_CAT()
{
using (SqlConnection con = new SqlConnection(myconn))
if (!IsPostBack)
{
SqlCommand com = new SqlCommand("select distinct Cat_name from tblCategory order by Cat_name ", con);
SqlDataReader dr;
con.Open();
Drp_CAT.Items.Clear();
dr = com.ExecuteReader();
while (dr.Read())
{
Drp_CAT.Items.Add(new ListItem(dr[0].ToString()));
}
con.Close();
}
}
Reply
Answers (
5
)
oops concept (interface)
Fast searching in the large database.