3
Answers

Need help in code

Nithika

Nithika

10y
817
1
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)