use MyModule
答案 0 :(得分:0)
添加.ExecuteNonQuery来执行查询,并添加try-catch-block来捕获任何异常:
try
{
...
SqlCommand com = new SqlCommand(queryStr, conn);
com.ExecuteNonQuery();
conn.Close();
...
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}