connection 调用 数据库 存储过程 带输入输出参数 谁能给一个用connection对象调用带 输入和输出参数 的数据库存储过程 的实例。谢谢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public void Mothed(int Person_ID) { try { string storedProcName = "PersonInfo_BulkDelete"; string connectionString = ConfigurationSettings.AppSettings["ConnectionStrings"]; SqlConnection connect = new SqlConnection(connectionString); SqlCommand command = new SqlCommand(storedProcName, connect); command.CommandType = CommandType.StoredProcedure; connect.Open(); SqlParameter sqlparam = new SqlParameter("@Person_ID", SqlDbType.Int, 4); sqlparam.Value = Person_ID; command.Parameters.Add(sqlparam); command.ExecuteNonQuery(); command.Dispose(); connect.Close(); } catch (Exception e) { Console.WriteLine(e.Message); } finally { } } string connectionString = ConfigurationSettings.AppSettings["ConnectionStrings"];这个是在web.config里写链接库字符串,可以这样写string connectionString = "Data Source=192.168.0.123;User ID=sa;Password=sa;" 请教一下geography类型查询二行数据的距离怎么算的 新手求助 急 请教各位高手! 查询库表中最大值,赋给变量的问题 sqlserver表碎片是如何产生的 小f ,PRIMARY KEY (栏目流水号) identity(int,1,1) mssql upsize_ts字段问题 如何恢复数据库表记录被“清除结果”操作误删除的表记录? 关于sql server的日期问题。在线等待。。。。 win10安装 sql2015 数据库 存储过程 abo execute exec 简单的sql问题,征求最简单的方法以及语句
public void Mothed(int Person_ID)
{
try
{
string storedProcName = "PersonInfo_BulkDelete";
string connectionString = ConfigurationSettings.AppSettings["ConnectionStrings"];
SqlConnection connect = new SqlConnection(connectionString);
SqlCommand command = new SqlCommand(storedProcName, connect);
command.CommandType = CommandType.StoredProcedure;
connect.Open();
SqlParameter sqlparam = new SqlParameter("@Person_ID", SqlDbType.Int, 4);
sqlparam.Value = Person_ID;
command.Parameters.Add(sqlparam);
command.ExecuteNonQuery();
command.Dispose();
connect.Close();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
finally
{ }
}
string connectionString = ConfigurationSettings.AppSettings["ConnectionStrings"];
这个是在web.config里写链接库字符串,可以这样写
string connectionString = "Data Source=192.168.0.123;User ID=sa;Password=sa;"