-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathsample17.vb
More file actions
21 lines (21 loc) · 873 Bytes
/
sample17.vb
File metadata and controls
21 lines (21 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub GetProductsWithPriceGreaterThan(ByVal price As SqlMoney)
'Create the command
Dim myCommand As New SqlCommand()
myCommand.CommandText = _
"SELECT ProductID, ProductName, SupplierID, CategoryID, " & _
" QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, " & _
" ReorderLevel, Discontinued " & _
"FROM Products " & _
"WHERE UnitPrice > @MinPrice"
myCommand.Parameters.AddWithValue("@MinPrice", price)
' Execute the command and send back the results
SqlContext.Pipe.ExecuteAndSend(myCommand)
End Sub
End Class