日期:2014-05-17 浏览次数:20917 次
string conString = @"data source=.\SQLEXPRESS;Database=XXXX_database;User Id=sa;Pwd=123456";
using (SqlConnection connection = new SqlConnection(conString))
{
try
{
connection.Open();
string strSQL = "Update MainTable Set State = '0' where ID = '201'";
SqlCommand sqlcom = new SqlCommand(strSQL, connection);
}
catch (System.Data.SqlClient.SqlException ex)
{
throw new Exception(ex.Message);
}
}