.Net service database problem

  • Thread starter Thread starter Andreas Hoetker
  • Start date Start date
A

Andreas Hoetker

Hi

I'm currently developing a simple VB.NET Windows Service
that shall receive files (including data) as an input and
write these data into a Access database. For this, I use
the OleDbCommand and - Database objects, provided by the
framework, and the follwing functions:
OleDbCommand.ExecuteNonQuery(),OleDbCommand.ExecuteReader
().
Now, sometimes, when I run the service I receive the
following exception (sorry, german):

System.InvalidOperationException: OleDbCommand ist
ausgelastet Open, Fetching

Unfortunately, I can't find anything helpful about this
in the documentation.
Can anyone help me out of this?

Andreas
 
Hi Andreas,

Can you post the full Error message in English? With the exact error
message and the code throwing the exception, we will a clear on what it is
going on there.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Hi

thanks for the answer!
The complete (english) error message is:

System.InvalidOperationException: The OleDbCommand is
currently busy Open, Fetching.
at System.Data.OleDb.OleDbCommand.OnSchemaChanging()
at System.Data.OleDb.OleDbCommand.set_CommandText(String
value)
at TestService.Database.MyFunction() 'TestService is
my .net service; Database a class for db accessing

Unfortunately, I can't give you the code that caused the
problem, because when I try to attach a debugger (via
VS.NET) at the running service process, everything works
slower (!) but fine (!!).

Could you guess what's going on here?

Thanks
Andreas
 
Hi Andreas,

Are the Database object or Myfunction statics? I mean, is it possible two
request call the method at same time? From the database layer, Access is
not very suitable for mutilple user environment, there may be some
conflicts under the situation. You may first check if the exception will
occur with single request. (Only one request to call the windows service,
and one object call the database class' method)

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no

rights.)
 
Back
Top