hc98br
ISP
- Aug 14, 2003
- 46
I very new to this, so excuse any ignorance, but I have the following problem!
I have the following code:
OleDbConnection is a data connection dragged onto the form
selectResults is the SelectCommand of the data adapter connected to OleDbConnection.
This code work fine, and does everything its supposed to do, but, if I run it a second time (click the button again), I get the follow error:
on the line Reader = selectResults.ExecuteReader().
Interestingly I have another section of code doing a similar thing, without the parameters, and that works fine, time and time again.
Any ideas most welcome
Thanks
Ben.
I have the following code:
Code:
OleDbConnection.Open()
selectResults.Parameters(0).Value = startDate
selectResults.Parameters(1).Value = endDate
Reader = selectResults.ExecuteReader()
While Reader.Read()
...
End While
OleDbConnection.Close()
Reader = Nothing
OleDbConnection is a data connection dragged onto the form
selectResults is the SelectCommand of the data adapter connected to OleDbConnection.
This code work fine, and does everything its supposed to do, but, if I run it a second time (click the button again), I get the follow error:
Code:
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
Interestingly I have another section of code doing a similar thing, without the parameters, and that works fine, time and time again.
Any ideas most welcome
Thanks
Ben.