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 ...