string ConnectionString = "Data Source=数据源;Database=数据库名称;uid=用户;Pwd=密码";
string sql = "update 数据表 set 字段1= '开',字段2='" + dt + "' (where +限定条件);
SqlConnection conn = new SqlConnection(ConnectionString);
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = sql;
cmd.ExecuteNonQuery();
conn.Close();