▲▲▲▲奇怪问题,insert语句插入成功,但数据库中没有数据
constr = ConfigurationManager.ConnectionStrings[ "zsconstr "].ToString();
SqlConnection conn = new SqlConnection(constr);
conn.Open();
try
{
foreach (DataRow row in dtSet.Tables[0].Rows)
{
sqlstr = "insert into T_TDD(Ksh,Zkzh,xm) values( ' " + row[ "ksh "].ToString() + " ', ' " + row[ "Zkzh "].ToString() + " ', ' " + row[ "xm "].ToString() + " ') ";
//sqlstr = "insert into T_TDD(Ksh,Zkzh,xm) values( ' " + t + " ', ' " + w + " ', ' " + q + " ') ";
//dataconect.sqlexecute_noopen(sqlstr);
SqlCommand myComm = new SqlCommand(sqlstr, conn);
myComm.ExecuteNonQuery();
}
conn.Close();
MessageBox.Show( "success ");
}
catch (Exception e1)
{
MessageBox.Show(e1.ToString());
&