I'm slowly transitioning to VB.Net and it seems like the simplest of things are completely different. I'm trying to do a connection to SQL Server and just grab some data. I've tested the connection and it's fine. Now I'm trying to simply select some data from the server and display the first name in the Msgbox (or anything for that matter). Here is the code I've gotten so far....
Public Class Form1
Public conn As New SqlConnection("data source=Tuys1;initial catalog=DDDBuyer; user ID=userID; password=password")
Private dA As New SqlDataAdapter("Select FirstName, LastName from tblBuyers where Buyerid=1473", conn)
Private dS As New DataSet
if ds.hasrows then
msgbox = "HELLO"
Dim custAdapter As SqlDataAdapter = New SqlDataAdapter( _ "SELECT * FROM dbo.Customers", customerConnection) Dim ordAdapter As OleDbDataAdapter = New OleDbDataAdapter( _ "SELECT * FROM Orders", orderConnection) Dim customerOrders As DataSet = New DataSet() custAdapter.Fill(customerOrders, "Customers") ordAdapter.Fill(customerOrders, "Orders") Dim relation As DataRelation = _ customerOrders.Relations.Add("CustOrders", _ customerOrders.Tables("Customers").Columns("CustomerID"), _ customerOrders.Tables("Orders").Columns("CustomerID")) Dim pRow, cRow As DataRow For Each pRow In customerOrders.Tables("Customers").Rows Console.WriteLine(pRow("CustomerID").ToString()) For Each cRow In pRow.GetChildRows(relation) Console.WriteLine(vbTab & cRow("OrderID").ToString()) Next Next