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
Gaurav Jadhav
NA
6
4.4k
how to add checked rows of datagridview into database
Mar 6 2013 7:35 AM
how to add checked rows of datagridview into database in visual studio 2010 windows application form.
plz help
i hd written this code but throwing error on CheckBox chkbx = (CheckBox)row.FindControl("chkbx"); this line.
foreach (DataGridViewRow row in dataGridView1.Rows)
{
CheckBox chkbx = (CheckBox)row.FindControl("chkbx");
if (chkbx .Checked == true )
{
con.Close();
con.Open();
com.Connection = con;
string str = "insert into EmpDetails values ('" + row.Cells[2].Value.ToString() + "','" + row.Cells[3].Value.ToString() + "')";
com.CommandText = str;
dr = com.ExecuteReader();
MessageBox.Show("Success.....");
dr.Close();
}
Reply
Answers (
4
)
how to auto increment a column in a specific format
How to retrieve a column name and set to textbox