Nithika

Nithika

  • NA
  • 63
  • 18.9k

Need help in code

Jun 3 2014 1:30 PM
My execute query is not executing inside loop.
foreach(DataRowrow1 indt.Rows)
{
   EmpNo = (row1["EmpNo"].ToString());
   EmpName = (row1["EmpName"].ToString());
   command.CommandText = "insert into table(id,EmpNo,EmpName) values("+ id+ ","+ EmpNo + ",'"+ EmpName + "')";
   command.ExecuteNonQuery();
}    
please help me

Answers (3)