.Net service database problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andreas Hoetker

    #1

    .Net service database problem

    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.Ex ecuteNonQuery() ,OleDbCommand.E xecuteReader
    ().
    Now, sometimes, when I run the service I receive the
    following exception (sorry, german):

    System.InvalidO perationExcepti on: 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
  • MSFT

    #2
    RE: .Net service database problem

    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.)


    Comment

    • Andreas Hoetker

      #3
      RE: .Net service database problem

      Hi

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

      System.InvalidO perationExcepti on: The OleDbCommand is
      currently busy Open, Fetching.
      at System.Data.Ole Db.OleDbCommand .OnSchemaChangi ng()
      at System.Data.Ole Db.OleDbCommand .set_CommandTex t(String
      value)
      at TestService.Dat abase.MyFunctio n() '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

      Comment

      • MSFT

        #4
        RE: .Net service database problem

        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.)

        Comment

        • sir
          New Member
          • Oct 2005
          • 1

          #5
          RE: System.InvalidO perationExcepti on: The OleDbCommand is currently busy Open, Fetchi

          The problem is probably in the following:
          After making query on that command which returned OleDbDataReader
          you haven't done
          OleDbDataReader .Close();
          before calling next
          command.Execute NonQuery();
          or
          command.Execute Reader();

          Good Luck

          Comment

          • pradeepn
            New Member
            • Jul 2006
            • 1

            #6
            Hi "Sir"
            Thanks for the help provided on this thread. It was really very critical issue I was working at.

            Thanks again,
            Pradeep

            Comment

            Working...