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
timothy.farrell
NA
105
0
Something wrong with C# dropdown list
May 11 2004 2:41 PM
I can't seem to get my dropdown list to populate.
Webform:
Code Behind:
void ddl_DataBind() { SqlConnection SqlConn = new SqlConnection("server=c099450d01;uid=sa;pwd=;database=Tools"); SqlCommand SqlCmd = new SqlCommand("SELECT UID, LastName, FirstName FROM Employee ORDER BY LastName", SqlConn); SqlConn.Open(); ddl.DataSource = SqlCmd.ExecuteReader(CommandBehavior.CloseConnection); ddl.DataTextField = "LastName,FirstName"; ddl.DataValueField = "UID"; ddl.DataBind(); } I don't get any errors, just that the dropdown list doesn't contain any data. Thanks again for all your help. Sincerely, Tim
Reply
Answers (
11
)
If Then Else Stmt in C#
How to obtain data in a row in List view