Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim myConn As SqlConnection = New SqlConnection("Data Source=localhost;Integrated Security=SSPI;Initial Catalog=northwind")
Dim orderConn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Temp\northwind.mdb;")
Try
'Initialize DataSet.
Dim custDS As New DataSet()
'Initialize SqlDataAdapter with SQL and Connection String.
Dim custDA As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM Customers", myConn)
'Initialize OleDbDataAdapter with SQL and Connection string
Dim orderDA As OleDbDataAdapter = New OleDbDataAdapter("SELECT * FROM Orders", orderConn)
'Open connection.
myConn.Open()
orderConn.Open()
'Fill DataSet with data from DataAdapter.
custDA.Fill(custDS, "Customers")
orderDA.Fill(custDS, "Orders")
'Add relationship to the DataSet.
Dim custOrderRel As DataRelation = custDS.Relations.Add("CustOrders", _
custDS.Tables("Customers").Columns("CustomerID"), _
custDS.Tables("Orders").Columns("CustomerID"))
'Bind DataSet to the DataGrid.
grdDetails.SetDataBinding(custDS, "Customers")
Me.Size = New System.Drawing.Size(512, 458)
Catch Excep As SqlClient.SqlException
MessageBox.Show(Excep.Message & " " & Excep.Number, "SQL Server", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
'Close connection.
myConn.Close()
orderConn.Close()
End Try