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.
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);
}
以上
如果想把以上存储过程的返回结果体现在DataList控件中,应用程序端的调用代码是什么样的?