S
Simon Harris
Hi All,
I wish to populate more than one datagrid from the same OleDBCommand. The
code I have is:
Dim objCmd As New OleDbCommand(strSql, objConn)
Then...
Me.dgTariffHolidayHomesBand1.DataSource = objCmd.ExecuteReader()
Me.dgTariffHolidayHomesBand1.Visible = True
Me.dgTariffHolidayHomesBand2.DataSource = objCmd.ExecuteReader()
Me.dgTariffHolidayHomesBand2.Visible = True
I get this error when the second call to objCmd.ExecuteReader() is called:
System.InvalidOperationException: ExecuteReader requires an open and
available Connection.
The reason for populating multiple grids from the same data, is that I am
calling ALL columns in the SQL, and then using (for example) columns A and
B
in DG1, C and D in DG2...and so on.
Surely I don't need a new recordset for each datagrid???
Simon.
I wish to populate more than one datagrid from the same OleDBCommand. The
code I have is:
Dim objCmd As New OleDbCommand(strSql, objConn)
Then...
Me.dgTariffHolidayHomesBand1.DataSource = objCmd.ExecuteReader()
Me.dgTariffHolidayHomesBand1.Visible = True
Me.dgTariffHolidayHomesBand2.DataSource = objCmd.ExecuteReader()
Me.dgTariffHolidayHomesBand2.Visible = True
I get this error when the second call to objCmd.ExecuteReader() is called:
System.InvalidOperationException: ExecuteReader requires an open and
available Connection.
The reason for populating multiple grids from the same data, is that I am
calling ALL columns in the SQL, and then using (for example) columns A and
B
in DG1, C and D in DG2...and so on.
Surely I don't need a new recordset for each datagrid???
Simon.