Nithika

Nithika

  • NA
  • 63
  • 19k

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)