ExecuteStoreQuery VfpClient.VfpException (0x80004005): Invalid path or file name

Sep 9, 2015 at 5:29 PM
The following code causes an exception:

string cmdText = amenId == null ?
            "Select * from rentalunitamenitiesmm" :
            "Select * from rentalunitamenitiesmm where amen_id = " + amenId;
---> var results = db.ExecuteStoreQuery<rentalunitamenitiesmm>(cmdText, null).ToList();
        return results;
However, calls to the same context such as this work fine:

db.Rentalunits.ToList();



VfpClient Error: 0 : VfpClient.VfpException (0x80004005): Invalid path or file name. ---> System.Data.OleDb.OleDbException (0x80040E21): Invalid path or file name.
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at VfpClient.VfpConnection.Open()
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
A first chance exception of type 'VfpClient.VfpException' occurred in VfpClient.dll
A first chance exception of type 'System.Data.EntityException' occurred in System.Data.Entity.dll
A first chance exception of type 'System.Data.EntityException' occurred in mscorlib.dll
A first chance exception of type 'System.Data.EntityException' occurred in mscorlib.dll
A first chance exception of type 'System.Data.EntityException' occurred in mscorlib.dll
A first chance exception of type 'System.Data.EntityException' occurred in mscorlib.dll
Coordinator
Sep 9, 2015 at 10:38 PM
I would need to know more about your project to identify the source of the problem. Could you provide an example project for me to use to debug the issue? If so, you can email it to me tombrothers@outlook.com.