惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
小众软件
小众软件
GbyAI
GbyAI
B
Blog RSS Feed
月光博客
月光博客
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
博客园_首页
G
Google Developers Blog

博客园 - csu02

erp asp+com 删除表的一列 更改列名 分页 千万数量级分页存储过程 XML的五种用途~ 表的列数 列名 得到一个省份,城市数据库 window.open()的所有参数列表 存儲過程解密SQL 分页控件 SqlCommand 与 SqlDataAdapter 产生一个int数组,长度为100,并向其中随机插入1-100 dataGrid使用 绑定 定向到Url 学到的程序结构 几个系统 利用IFRAME 让每个页面都继承菜单控 不是用户自定义控件来实现的 C#事件机制学习 完成单元测试
返回存儲過程的多個輸出字段
csu02 · 2006-07-22 · via 博客园 - csu02

存儲過程:
CREATE procedure User_Login
@user_id varchar(20),
@password varchar(50),
@Return_Status char(1) output,
@user_name varchar(20) output,
@dept varchar(20) output,
@duty varchar(20) output,@Evaluate varchar(1)='N' output
AS 
declare @dept_id varchar(4)
declare @duty_id varchar(4)
select @dept=''
select @duty=''
select @user_name=''
select @return_status='0' --不知明錯誤

if exists(select user_id from user_list where user_id=@user_id)
begin
if exists(select user_id from user_list where user_id=@user_id and password=@password)
begin
select @user_name=user_name,@dept_id=dept_id,@duty_id=duty_id,@Evaluate=is_Evaluate from user_list where user_id=@user_id and password=@password
select @dept=sname from dept_list where dept_id=@dept_id
select @duty=sname from duty_list where duty_id=@duty_id
select
@return_status='3'--正確登錄
end
else
select @return_status='2'--密碼錯誤
end
else
select @return_status='1'--用戶名不存在
GO

方法:
public string[]  user_login(string user_id,string password)
{                         mabuchi.Class.SqlHelper sqlhelper = new SqlHelper();          
                          string [] erp = new string [5];                                             //接收数组
                            SqlParameter [] paramlist = { sqlhelper.CreateInParam("@User_id",SqlDbType.VarChar,20,user_id),
                                          sqlhelper.CreateInParam("@password",SqlDbType.VarChar,50,password),
                                          sqlhelper.CreateOutParam("@Return_Status",SqlDbType.VarChar,1),
                                          sqlhelper.CreateOutParam("@user_name",SqlDbType.VarChar,1),
                                          sqlhelper.CreateOutParam("@dept",SqlDbType.VarChar,20),
                                         sqlhelper.CreateOutParam("@duty",SqlDbType.VarChar,20),
                                          sqlhelper.CreateOutParam("@Evaluate",SqlDbType.VarChar,1)
};
try
{
                 sqlhelper.RunProc("User_Login ",paramlist);
                 erp[0] = paramlist[0].Value.ToString();
                   ...
                 erp[4] = parmlist[6].Value.ToString();
               return erp;
}