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
SAM J
NA
24
33.2k
SQL Database to DataGridView in C#.Net
Mar 21 2011 2:06 PM
So far i have done the following...
SqlConnection cnn = new SqlConnection(ConfigurationSettings.AppSettings["strConnection"]);
cnn.Open();
SqlCommand scd = new SqlCommand("select query", cnn);
SqlDataAdapter sda = new SqlDataAdapter(scd);
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
DataSet ds = new DataSet();
sda.Fill(ds);
bindingSource1.DataSource = ds;
dataGridView1.DataSource = bindingSource1;
cnn.Close();
But this code isnt much help to me.it does not display data in datagridview. I want to retrive data from 2 different tables of Database.
Are there any settings i need to do b4 using BindingSource and DataGrid view??
How can i use DataReader for the same.
Reply
Answers (
4
)
How to append the content in the list box to the text file...?
BackgroundImage property not changing.