ASP.NET2.0编写扩展存储过程的问题

分类: asp.net技巧   出处:iocblog整理  更新时间:2009-11-02   添加到收藏  

sqlpipe 类
c#  复制代码
[microsoft.sqlserver.server.sqlprocedure()]
public static void storedprocexecutecommand(int rating)
{
    // connect through the context connection.
    using (sqlconnection connection = new sqlconnection("context connection=true"))[iocblog.net 来源]
    {
        connection.open();

        sqlcommand command = new sqlcommand(
            "select vendorid, accountnumber, name from purchasing.vendor " +
            "where creditrating <= @rating", connection);
        command.parameters.addwithvalue("@rating", rating);

        // execute the command and send the results directly to the client.
        sqlcontext.pipe.executeandsend(command);
       
    }
以上存储过程的执行结果怎么样在asp.net2.0应用程序端来调用?
如果想把以上存储过程的返回结果体现在datalist控件中,应用程序端的调用代码是什么样的?

http://www.cnblogs.com/aspnet2008/archive/2006/08/14/476478.html[iocblog.net 来源]


Tag: 存储过程



文章整理:iocblog
版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。