andreasen
May 4th, 2004, 08:16 PM
Does anyone have any tips on how to perform a SELECT query with a WHERE clause in a C# windows app using oleDB connection? I've tried using the wizard to create a control that does this as well as doing it by hand
try
{
oleDbDataReader = oleDbSelectCommand.ExecuteReader();
}
catch (System.InvalidOperationException e)
{
}
while (oleDbDataReader.Read() == true)
{
< ... implement DB manipulation logic ... >
}
But this continues to generate the following OleDbExceptions:
"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
Since this is not listed in the ExecuteReader() exceptions, I'm not sure what is causing it or how to work-around it.
The test file attached is about as narrow as I can make it to demonstrate the problem. The DB (test.mdb) contains a table (BlockData) that has 2 columns (ID, Session - both numbers).
This is my first time implementing data access using VS.NET. Does anyone have experience with this type of problem in C# or VS.NET that can help me find a work-around. Thanks.
-b
try
{
oleDbDataReader = oleDbSelectCommand.ExecuteReader();
}
catch (System.InvalidOperationException e)
{
}
while (oleDbDataReader.Read() == true)
{
< ... implement DB manipulation logic ... >
}
But this continues to generate the following OleDbExceptions:
"An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
Since this is not listed in the ExecuteReader() exceptions, I'm not sure what is causing it or how to work-around it.
The test file attached is about as narrow as I can make it to demonstrate the problem. The DB (test.mdb) contains a table (BlockData) that has 2 columns (ID, Session - both numbers).
This is my first time implementing data access using VS.NET. Does anyone have experience with this type of problem in C# or VS.NET that can help me find a work-around. Thanks.
-b