设断点调试. 就可以了! using System.Data.SqlClient; SqlConnection con = new SqlConnection("server=.;database=你数据库的称;uid=;pwd="); con.Open(); SqlCommand com = new SqlCommand("你的数据执行脚本粘贴进来就可以了"); SqlDataReader dr=com.ExecuteReader(); if(dr.Read())//读取一行 {
} 在SqlCommand com = new SqlCommand("你的数据执行脚本粘贴进来就可以了");查看dr的值就可以了
然后在程序里调用那个存储过程即可!
+" table_1"
+" where id = 2"
+" go"
+" select * from"
+" table_2 where id=3";写多少都可以啊。
然后保存出来了。想通过vs调用。我觉得。lz可以使用事务来处理。vs支持事务的处理。
using System.Data.SqlClient; SqlConnection con = new SqlConnection("server=.;database=你数据库的称;uid=;pwd=");
con.Open();
SqlCommand com = new SqlCommand("你的数据执行脚本粘贴进来就可以了");
SqlDataReader dr=com.ExecuteReader();
if(dr.Read())//读取一行
{
}
在SqlCommand com = new SqlCommand("你的数据执行脚本粘贴进来就可以了");查看dr的值就可以了
企业管理器 数据库 可编程性 新建存储过程 执行 ,存储过程里就有存储过程aausing (SqlConnection conn = new SqlConnection(connstr))
{
conn.Open();
SqlCommand cmd = new SqlCommand() ;
cmd.Connection=conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "aa";
cmd.ExecuteNonQuery();
}