首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

怎么调用存储过程

2012-03-09 
如何调用存储过程名字为 a 带传入参数的存储过程里面 exec(select * from user where name@name )请问 程

如何调用存储过程
名字为 a 带传入参数的存储过程
 里面 exec(select * from user where name=@name )
请问 程序里如何调用?

[解决办法]

C# code
            SqlCommand cmd = new SqlCommand();            cmd.Connection =  conn;//数据库连接            cmd.CommandText = "exec a";             CommandType.StoredProcedure            cmd.CommandType =// type;            SqlDataAdapter da = new SqlDataAdapter(cmd);              da.Fill("table1");
[解决办法]
SqlCommand cmd = new SqlCommand();
 cmd.Connection = conn;
cmd.CommandType=CommandType.StoreProcedure
 cmd.CommandText =存储过程名
cmd.execureScalar();
[解决办法]
探讨
C# code


SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;//数据库连接
cmd.CommandText = "exec a";
CommandType.StoredProcedure
……

热点排行