9
Reply

how to fill data in sql server??

vinod jangir

vinod jangir

Oct 2 2015 6:30 AM
479
 i add Test_Result column in table and i fill data from client side but i confuse
help me 
 
 
 
for (int r = 0; r < dataGridView1.RowCount; r++)
{
if (con.State == ConnectionState.Closed)
con.Open();
SqlCommand cmd1 = new SqlCommand ("Insert Into Admission(Test_Result) Values (" + Row[Test_Result].ToString() +")");
//cmd1.Parameters.AddWithValue("Test_Result", dataGridView1.Rows[e.RowIndex].Cells[3].Value);
com.ExecuteNonQuery();
con.Close();
FrmTest fc = new FrmTest();
MessageBox.Show("Inserted sucessfully");
this.Close();
}

Answers (9)