Chinaunix首页 | 论坛 | 博客
  • 博客访问: 11218999
  • 博文数量: 8065
  • 博客积分: 10002
  • 博客等级: 中将
  • 技术积分: 96708
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-16 17:06
文章分类

全部博文(8065)

文章存档

2008年(8065)

分类: 服务器与存储

2008-04-29 08:22:51

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"))
    {
        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控件中,应用程序端的调用代码是什么样的?

阅读(1744) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~