Private Function GetConnectionString() As String
' To avoid storing the connection string in your code,
' you can retrive it from a configuration file.
Return "Data Source=(local);Integrated Security=true;" & _
"Initial Catalog=AdventureWorks;"
End Function
Private Function GetSQL() As String
Return "SELECT Production.Product.ProductID, " & _
"Production.Product.Name, " & _
"Production.Location.Name AS Location, " & _
"Production.ProductInventory.Quantity " & _
"FROM Production.Product INNER JOIN " & _
"Production.ProductInventory " & _
"ON Production.Product.ProductID = " & _
"Production.ProductInventory.ProductID " & _
"INNER JOIN Production.Location " & _
"ON Production.ProductInventory.LocationID = " & _
"Production.Location.LocationID " & _
"WHERE ( Production.ProductInventory.Quantity <= 100) " & _
"ORDER BY Production.ProductInventory.Quantity, " & _
"Production.Product.Name;"
End Function