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
narasiman rao
NA
519
767.7k
column to be retrieved from the data base in the DGV
Jan 9 2013 5:35 AM
con.Open();
SqlCommand cmd = new SqlCommand("select Faculty_Name from Tb_SCH_Faculty_Details", con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
datagridView.Columns[2].HeaderText = dr[2].ToString().Trim();
datagridView.Columns[3].HeaderText = dr[2].ToString().Trim();
datagridView.Columns[4].HeaderText = dr[2].ToString().Trim();
datagridView.Columns[5].HeaderText = dr[2].ToString().Trim();
datagridView.Columns[6].HeaderText = dr[2].ToString().Trim();
dr.Close();
con.Close();
}
when i run message shows index was outside the bound of array.
please help me. i want to use the data reader through data reader i get the Faculty Name from the data base.
Reply
Answers (
2
)
How to get the combobox value to another form....
c# Win Forms