程序中存储过程的使用
来源:互联网 发布:淘宝支付限额怎么使用 编辑:程序博客网 时间:2024/05/24 02:37
SqlCommand cmd =new SqlCommand("proGetEmpPassword", cn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter paramLoginName=new SqlParameter("@LoginName", SqlDbType.Char, 20);
paramLoginName.Value = strLoginName;
cmd.Parameters.Add(paramLoginName);
SqlParameter paramPassword=new SqlParameter("@Pword", SqlDbType.VarChar, 50);
paramPassword.Direction = ParameterDirection.Output;
cmd.Parameters.Add(paramPassword);
SqlParameter paramReturn=new SqlParameter("@ReturnValue", SqlDbType.Int);
paramReturn.Direction = ParameterDirection.ReturnValue;
cmd.Parameters.Add(paramReturn);//在存储过程中为return @@rowcount,用 来判断,区别select @orderId=@@identity
string arPword ;
try
{
cn.Open();
cmd.ExecuteNonQuery();
if (Convert.ToInt32(paramReturn.Value) == 1)
arPword = (paramPassword.Value).ToString();
else
return null;
}
catch
{
return null;
}
finally
{
if (cn.State == ConnectionState.Open)
cn.Close();
}
return arPword;
}
- 程序中存储过程的使用
- 程序中使用存储过程
- 在程序中使用存储过程
- 在SQL Server 2005 中使用.net程序集的注意(CLR存储过程篇)
- 轮询程序中使用的各种方法:spring调用;http调用;存储过程调用;
- 轮询程序中使用的各种方法:spring调用;http调用;存储过程调用;
- 轮询程序中使用的各种方法:spring调用;http调用;存储过程调用;
- asp中使用简单的存储过程
- 销售系统中使用的存储过程
- Asp.net中存储过程的使用
- .net 中存储过程的使用
- 存储过程中IN 参数的使用
- 存储过程中事务的使用
- 存储过程中循环的使用
- vb.net中存储过程的使用
- Oracle中存储过程的使用
- 存储过程中使用事务的方法
- MySQL 中存储过程的使用
- C#中的“装箱”(boxing)与“拆箱”(unboxing)
- 看看别人的程序:C# ---五子棋游戏
- C#的接口
- 在weblogic的portal中建立集成原来的structs项目
- 刚来
- 程序中存储过程的使用
- SQL Server 中的XML支持,查询返回XML,Web访问SQL取XML形式结果
- 读懂主板的“身份证”—BIOS-ID[转载]
- 想知道socket如何用
- 系统表
- 深入探究NetBeans 6.0中新的核心功能
- 动态多附件上传 多附件动态上传
- Hash Table 哈希表介绍
- UML学习-------UML简介