c#求解 cc# 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DbCommand cmd,cmd.CommandType = CommandType.Storage;cmd.Text="存储过程名称";跟查文本一样的,就CommandType 设置下 using (SqlConnection conn = new SqlConnection("链接字符串")) { string sql = "存储过程名"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@参数1","参数值"), new SqlParameter("@参数2","参数值") }; using (SqlCommand cmd = new SqlCommand(sql, conn)) { cmd.CommandType = System.Data.CommandType.StoredProcedure; //就这一句和执行普通sql不一样 cmd.Parameters.AddRange(param); conn.Open(); cmd.ExecuteNonQuery(); } } http://blog.csdn.net/newdtech/article/details/7766981 那如果的 mvc+EF的 网站呢 找下ADO.Net,ADO.Net EF的资料看看那就知道了。 SqlCommand cmd = new SqlCommand(“存储过程的名称”, 连接字符串) C# 打开一个子窗口始终显示在最前端 一个SQL语句的问题,怎么写这个SQL C#FORM程序如何做比较炫的界面? WPF中怎么把图像(BitmapImage)转换成Byte[]类型 无效的URI,无法确定URI的格式 C# Excel结束进程 js调用服务器控件问题 求删除数组中空元素的简单方法 webbrowser.Document.GetElementById为null?为什么 100分请问C/S方式“数据库连接串”的处理问题 VS能自动识别放进项目的代码文件吗? wpf中如何根据TextBlock中的文本的长度和字体大小,计算出该TextBlock的宽和高
cmd.CommandType = CommandType.Storage;
cmd.Text="存储过程名称";跟查文本一样的,就CommandType 设置下
using (SqlConnection conn = new SqlConnection("链接字符串"))
{
string sql = "存储过程名";
SqlParameter[] param = new SqlParameter[]
{
new SqlParameter("@参数1","参数值"),
new SqlParameter("@参数2","参数值")
}; using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.CommandType = System.Data.CommandType.StoredProcedure; //就这一句和执行普通sql不一样
cmd.Parameters.AddRange(param);
conn.Open();
cmd.ExecuteNonQuery();
}
}