本文整理匯總了VB.NET中Microsoft.SqlServer.Server.SqlContext類的典型用法代碼示例。如果您正苦於以下問題:VB.NET SqlContext類的具體用法?VB.NET SqlContext怎麽用?VB.NET SqlContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了SqlContext類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: StoredProcReturnResultSet
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub StoredProcReturnResultSet()
' Create the record and specify the metadata for the columns.
Dim record As New SqlDataRecord( _
New SqlMetaData("col1", SqlDbType.NVarChar, 100), _
New SqlMetaData("col2", SqlDbType.Int))
' Mark the begining of the result-set.
SqlContext.Pipe.SendResultsStart(record)
' Send 10 rows back to the client.
Dim i As Integer
For i = 0 To 9
' Set values for each column in the row.
record.SetString(0, "row " & i.ToString())
record.SetInt32(1, i)
' Send the row back to the client.
SqlContext.Pipe.SendResultsRow(record)
Next
' Mark the end of the result-set.
SqlContext.Pipe.SendResultsEnd()
End Sub