D
DC Gringo
This code has two SELECT statements, each returning several records. I want
to fill a dataset and then two datagrids. How would I fill the SECOND
datagrid from this code
-----
Sub BindSQL()
Dim MyConnection As SqlConnection
Dim DS as DataSet
Dim MyCommand As SqlDataAdapter
Dim RcdCount As Integer
'Our SQL string
Dim sqlStr As String = "SELECT title FROM authors SELECT au_lname FROM
authors"
'The connection to our database
Dim strConn As String = "server=(local);uid=sa;pwd=;" & _
"database=pubs;Trusted_Connection=yes;"
Next we need to instantiate our connection and command object, and the fill
our DataSet object with the results of the SQL query:
...
'Open up our connection with our connection object
MyConnection = New SQLConnection(strConn)
'To execute our Sql Statement and provide our active connection
MyCommand = NewSqlDataAdapter(sqlStr, MyConnection)
'Create instance of DataSet object and fill our predetermined
'datagrid with it and we name it
DS = new DataSet()
MyCommand.Fill(DS, "pubs")
to fill a dataset and then two datagrids. How would I fill the SECOND
datagrid from this code
-----
Sub BindSQL()
Dim MyConnection As SqlConnection
Dim DS as DataSet
Dim MyCommand As SqlDataAdapter
Dim RcdCount As Integer
'Our SQL string
Dim sqlStr As String = "SELECT title FROM authors SELECT au_lname FROM
authors"
'The connection to our database
Dim strConn As String = "server=(local);uid=sa;pwd=;" & _
"database=pubs;Trusted_Connection=yes;"
Next we need to instantiate our connection and command object, and the fill
our DataSet object with the results of the SQL query:
...
'Open up our connection with our connection object
MyConnection = New SQLConnection(strConn)
'To execute our Sql Statement and provide our active connection
MyCommand = NewSqlDataAdapter(sqlStr, MyConnection)
'Create instance of DataSet object and fill our predetermined
'datagrid with it and we name it
DS = new DataSet()
MyCommand.Fill(DS, "pubs")