在后台代码中调用该带参数的存储过程(在线等,解决立马给分)
ALTER PROCEDURE pr_topic @subject char(50)
AS
select * from forum_topic
where subject=@subject
RETURN
请问如何在后台代码中调用该带参数的存储过程
请各位大虾指点,谢谢啦
最好能两种方法都说说,sqlcommand和sqldataadapter
------解决方案--------------------这个例子很详细
http://www.5d.cn/Tutorial/webdevelop/.net/200412/1960.html
------解决方案--------------------myCommand = new SqlCommand( "pr_topic ", myConn);
myCommand.Parameters.Add(new SqlParameter( "@subject ", SqlDbType.VarChar, 50));
myCommand.Parameters[ "@username "].Value = subject;
sqldataadapter=new AqlDataAdapter(myCommand);