Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
in combo box data is not retrieved from the DB in WEB Applic
narasiman rao
Aug 13 2015 7:25 AM
306
Reply
my code as follows
SqlConnection conn = new SqlConnection("Data Source=DOCTOR\SQLEXPRESS;Initial Catalog=HIMT_Testing;User ID=sa;Password=himt123");
conn.Open();
SqlCommand sc = new SqlCommand("select Designation from Designations where active <>'d'", conn);
SqlDataReader reader;
reader = sc.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("Designation", typeof(string));
dt.Load(reader);
ComboBox1.DataTextField = "Designation";
ComboBox1.DataValueField = "Designation";
ComboBox1.DataSource = dt;
conn.Close();
in combo box data is not retrieved from the database.
what is the problem in my code. it is web application.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to export all repeater data in excel file
iam implementing linq to sql using stored procedure