//实例化sql连接
SqlConnection conn = new SqlConnection("server=.; database=dbName; uid=sa; pwd=sa");
conn.Open();
//实例化sql命令
SqlCommand cmd = new SqlCommand(sqlStr, conn);
//执行sql命令
cmd.ExecuteNonQuery();
//关闭连接
conn.Close();
sqlStr += "num int,";
sqlStr += "Colour varchar(50),";
sqlStr += "Other varchar(50),";
sqlStr += " )";
//实例化sql连接
string sss = "Data Source=(local);Initial Catalog=" + dataconnect + ";Integrated Security=True";
SqlConnection conn = new SqlConnection(sss );
conn.Open();
//实例化sql命令
SqlCommand cmd = new SqlCommand(sqlStr, conn);
//执行sql命令
cmd.ExecuteNonQuery();
//关闭连接
conn.Close();
新闻热点
疑难解答