码迷,mamicode.com
首页 > 其他好文 > 详细

调用存储过程修改

时间:2015-01-30 17:33:17      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

/// <summary>
/// 2014-12-09 吴海龙
/// 测试调用pacs存储过程
/// </summary>
/// <param name="inp_no">住院号</param>
/// <param name="icd">icd编码</param>
[WebMethod]
public void TestHISCONFIRMICD(String inp_no, string icd)
{
DataSet dsOrder = new DataSet();
ConnectionStringSettings sDB = ConfigurationManager.ConnectionStrings["PacsConnectionString"];
DbProviderFactory fDB = DbProviderFactories.GetFactory(sDB.ProviderName);
using (DbConnection connDB = fDB.CreateConnection())
{
connDB.ConnectionString = sDB.ConnectionString;
try
{
connDB.Open();
}
catch (Exception ex)
{
throw;
}
DbCommand cmdDB = connDB.CreateCommand();
cmdDB.CommandType = CommandType.StoredProcedure;
DbDataAdapter daDB = fDB.CreateDataAdapter();
cmdDB.CommandText = "HisConfirmID";
DbParameter dp = cmdDB.CreateParameter();
dp.ParameterName = "INP_NO";
dp.DbType = DbType.String;
dp.Value = inp_no;
cmdDB.Parameters.Add(dp);
DbParameter dp1 = cmdDB.CreateParameter();
dp1.ParameterName = "icd10";
dp1.DbType = DbType.String;
dp1.Value = icd;
cmdDB.Parameters.Add(dp1);
//cmdDB.Parameters.Add("@INP_NO", OracleType.VarChar);
//cmdDB.Parameters.Add("@icd10", OracleType.VarChar);
//cmdDB.Parameters["@INP_NO"].Value = inp_no;//list[1].ToString();
//cmdDB.Parameters["@icd10"].Value = icd;//list[2].ToString();
try
{
cmdDB.ExecuteNonQuery();
}
catch (Exception ex)
{
throw;
}
connDB.Close();
}

调用存储过程修改

标签:

原文地址:http://www.cnblogs.com/wuhailong/p/4262506.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!