Posted on: 6/14/2013 11:15:35 AM | Views : 327

FOLLOWING ARE THE CODE GIVE ERROR Object reference not set to an instance of an object.
THANKS aLL
string query = "Insert into godownRequsition(Modal,Spec,color,Types,reqQty) values('@Modal', '@Spec', '@color', '@Types', '@reqQty')"; SqlCommand cmd = new SqlCommand(query, conn);

foreach (DataGridViewRow dr in dataGridView1.Rows) {

string Column1 = dr.Cells["Column1"].Value.ToString(); string Column2 = dr.Cells["Column2"].Value.ToString(); string Column3 = dr.Cells["Column3"].Value.ToString(); string Column4 = dr.Cells["Column4"].Value.ToString(); string Column5 = dr.Cells["Column5"].Value.ToString();
...

Go to the complete details ...