本文整理汇总了C#中StoredProcedure.AddParameter方法的典型用法代码示例。如果您正苦于以下问题:C# StoredProcedure.AddParameter方法的具体用法?C# StoredProcedure.AddParameter怎么用?C# StoredProcedure.AddParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StoredProcedure
的用法示例。
在下文中一共展示了StoredProcedure.AddParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateDocumentCode
internal static StoredProcedure GenerateDocumentCode(string transactionType)
{
//TODO : XML config for SP name
StoredProcedure sp = new StoredProcedure("GenerateDocumentCode");
sp.AddParameter("@TransactionType", StoredProcedure.ParameterType.String, 30, transactionType);
return sp;
}
示例2: GetUserName
public static string GetUserName(string user)
{
string userName;
StoredProcedure sp;
sp = new StoredProcedure("SP_GetUserName");
sp.AddParameter("app_user", user, SqlDbType.VarChar, 30);
userName = sp.GetStringValue();
return userName;
}
示例3: IsValidUser
public static bool IsValidUser(string user, string pwd)
{
string md5Pwd;
string md5DbPwd;
StoredProcedure spPwd;
StoredProcedure spUser;
bool existUser;
if (user == null) {
throw new ArgumentNullException("key");
}
if (user.Length == 0) {
throw new ArgumentException("\"user\" cannot be an empty string", "user");
}
if (pwd == null) {
throw new ArgumentNullException("key");
}
if (pwd.Length == 0) {
throw new ArgumentException("\"pwd\" cannot be an empty string", "pwd");
}
spUser = new StoredProcedure("SP_ExistUser");
spUser.AddParameter("user", user, SqlDbType.VarChar, 30);
existUser = spUser.GetBooleanValue();
if (!existUser) {
return false;
}
spPwd = new StoredProcedure("SP_GetPwd");
spPwd.AddParameter("user", user, SqlDbType.VarChar, 30);
md5DbPwd = spPwd.GetStringValue();
md5Pwd = Cryptography.MD5(pwd);
if (md5Pwd == md5DbPwd) {
return true;
}
else {
return false;
}
}