累了几天,也没有时间去写点东西,来总结项目用到一些值得去总结和记录下来的知识点。本来说昨天做的,谁知喝了个大醉,还差点闹出乱子来,因此今天还是很有点懒散来总结一点的。我们经理走了,这两天更新了好多的东西,呵呵,今天是我第一次代表我们经理发布系统,对自己真的还有点怀疑,因为以前经理在的时候,我也没有问过他发布的行不行,因此,就根据在学校时发布方式就发布了,真怕明天电话又被打爆了
费话不多说,今天我就说说使用存储过程吧!
怎样在asp.net中调用多参数、多返回参数的存储过程,当然,在这里存储过程我就不写,只把程序中的部分代码pia出来就行了,如下
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
1
double[] MoneyInfo = new double[7];
2
try
3![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
4![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
SqlParameter[] ParaList =
{
5
DataBase.DataBase.CreateInParam("@Out_LSH",SqlDbType.Int,4,TransitionDataType.StringToInt32(Public.NullToEmpty(OutLSH))),//流水号
6
DataBase.DataBase.CreateInParam("@HI_Code",SqlDbType.VarChar,10,Public.NullToEmpty(Ybhm)), //医保号码
7
DataBase.DataBase.CreateInParam("@YiLiaoLeiXing",SqlDbType.Int,4,Yllx), //医疗类型
8
DataBase.DataBase.CreateInParam("@HospitalID",SqlDbType.VarChar,10,HospitalID), //医院ID
9
10
DataBase.DataBase.CreateOutParam("@AllMoney",SqlDbType.Money,8),//总金额
11
DataBase.DataBase.CreateOutParam("@CashMoney",SqlDbType.Money,8), //实收现金
12
DataBase.DataBase.CreateOutParam("@AddCashMoney",SqlDbType.Money,8),//加收现金
13
DataBase.DataBase.CreateOutParam("@AccountMoney",SqlDbType.Money,8),//个人账户出支
14
DataBase.DataBase.CreateOutParam("@TongChouMoney",SqlDbType.Money,8),//统筹账户
15
DataBase.DataBase.CreateOutParam("@BalanceMoney",SqlDbType.Money,8),//个人账户余额
16
DataBase.DataBase.CreateOutParam("@YuFuKuan",SqlDbType.Money,8)//总预付款
17
};
18
SqlConnection conn = new SqlConnection();
19
conn.ConnectionString = DataBase.DataBase.connHospitalString;
20
SqlCommand cmd = new SqlCommand();
21
cmd.CommandType = CommandType.StoredProcedure;
22
cmd.CommandText = "Pro_CommonHospitalMoney";
23
//添加参数
24
if (ParaList != null)
25![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
26
foreach (SqlParameter para in ParaList)
27![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
28
cmd.Parameters.Add(para);
29
}
30
}
31
cmd.Connection = conn;
32
conn.Open();
33
cmd.ExecuteNonQuery();
34
conn.Close();
35![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
36
MoneyInfo[0] = double.Parse(cmd.Parameters["@AllMoney"].Value.ToString()); //总金额
37
MoneyInfo[1] = double.Parse(cmd.Parameters["@CashMoney"].Value.ToString()); //实收现金
38
MoneyInfo[2] = double.Parse(cmd.Parameters["@AddCashMoney"].Value.ToString()); //加收现金
39
MoneyInfo[3] = double.Parse(cmd.Parameters["@AccountMoney"].Value.ToString()); //个人账户出支
40
MoneyInfo[4] = double.Parse(cmd.Parameters["@TongChouMoney"].Value.ToString()); //统筹账户
41
MoneyInfo[5] = double.Parse(cmd.Parameters["@BalanceMoney"].Value.ToString()); //个人账户余额
42
MoneyInfo[6] = double.Parse(cmd.Parameters["@YuFuKuan"].Value.ToString()); //总预付款
43![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
44
}
45
catch (Exception ex)
46![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
47![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
48
throw ex;
49
}
50
return MoneyInfo;
51
好了,写完了、也喷完了、也更新完了。今天到此为止
好了,写完了、也喷完了、也更新完了。今天到此为止
费话不多说,今天我就说说使用存储过程吧!
怎样在asp.net中调用多参数、多返回参数的存储过程,当然,在这里存储过程我就不写,只把程序中的部分代码pia出来就行了,如下
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
14
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
15
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
16
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
18
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
19
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
20
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
21
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
22
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
23
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
24
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
25
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
26
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
27
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
28
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
29
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
30
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
31
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
32
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
33
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
34
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
35
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
36
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
37
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
38
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
39
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
40
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
41
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
42
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
43
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
44
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
45
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
46
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
47
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
48
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
49
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
50
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
51
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
好了,写完了、也喷完了、也更新完了。今天到此为止
好了,写完了、也喷完了、也更新完了。今天到此为止