A
Andi
Hello,
I'm hoping that someone out there can help me out of this.
I'm having several DataAdapters which are referencing all to the same
OleDbConnection object. At construction time of my DAL component, the
connection is instantiated (but not opened yet) and given a connection
string.
Once I want to access the database, I construct an instance of the
according DataAdapter, assign the OleDbConnection to its SELECT,
INSERT, UPDATE and DELETE commands and finally open the connection.
When I want to execute the query, e.g. when I call the Fill() method of
the adapter, I get an exception telling me that the database could not
be found.
The weird thing about this is the fact, that the database path returned
by the exception is _not_ the one I specified in my connection string
in the first place.
In fact, the path stated by the exception points to an old location I
used several days ago.
So I debugged my application and stopped at the line containing the
Fill() command:
try
{
...
-> myAdapter.Fill( dataset, tablename);
}
catch(Exception ex)
{
...
}
When examining the connections assigned to the SELECT, INSERT, UPDATE
and DELETE commands of 'myAdapter', all of them pointed to the correct
database.
I really don't know where the Fill() command gets the old path from. Am
I overlooking something?
Andi
I'm hoping that someone out there can help me out of this.
I'm having several DataAdapters which are referencing all to the same
OleDbConnection object. At construction time of my DAL component, the
connection is instantiated (but not opened yet) and given a connection
string.
Once I want to access the database, I construct an instance of the
according DataAdapter, assign the OleDbConnection to its SELECT,
INSERT, UPDATE and DELETE commands and finally open the connection.
When I want to execute the query, e.g. when I call the Fill() method of
the adapter, I get an exception telling me that the database could not
be found.
The weird thing about this is the fact, that the database path returned
by the exception is _not_ the one I specified in my connection string
in the first place.
In fact, the path stated by the exception points to an old location I
used several days ago.
So I debugged my application and stopped at the line containing the
Fill() command:
try
{
...
-> myAdapter.Fill( dataset, tablename);
}
catch(Exception ex)
{
...
}
When examining the connections assigned to the SELECT, INSERT, UPDATE
and DELETE commands of 'myAdapter', all of them pointed to the correct
database.
I really don't know where the Fill() command gets the old path from. Am
I overlooking something?
Andi