I've only dealt with firing a single SQL statement at a SQLServer table and returning a single result... easy....
however....
is there a way to fire a dual sql command and load the results into respective tables within a dataset?.. I'm thinking something along these lines (this code of course does not work)
however....
is there a way to fire a dual sql command and load the results into respective tables within a dataset?.. I'm thinking something along these lines (this code of course does not work)
Code:
Dim ds As New DataSet
Dim dt1 As DataTable = ds.Tables(0)
Dim dt2 As DataTable = ds.Tables(1)
Dim con As New OleDbConnection(MyConnectionString)
Dim cmd As New OleDbCommand
Dim dr As OleDbDataReader
Dim sql As String
''''''''''''NOTICE HOW THERE ARE TWO SELECT STATEMENTS HERE
sql = "Select * from Holidays; Select * from UserTable"
con.Open()
cmd.CommandText = sql
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.read
dt1.Load(dr)
dt2.Load(dr)
End While
Comment