HELP close database connection

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

    #1

    HELP close database connection

    Can someone please help me close this db connection. I know the
    connection is not closed because there;s a ldb file in my db folder.

    dbCommand.Conne ction.Open();
    IDataReader myReader = dbCommand.Execu teReader();

    while (myReader.Read( ))
    {
    return myReader.GetStr ing(1);
    }
    myReader.Close( );
    dbCommand.Conne ction.Close();

    Thanaks
  • Nicole Calinoiu

    #2
    Re: HELP close database connection

    Aaron,

    How long have you waited for the LDB file to disappear? Unless you've been
    tweaking the connection timeout values, you should wait at least a minute
    after closing the connection since that's the default timeout for actually
    releasing the connection from the connection pool after it's closed.

    If you still see the LDB file after a minute has elapsed, check the
    following:
    1. Are there any other connections open to your db?
    2. Does the user in whose context the code is running have permissions to
    delete files from the containing folder? If not, the LDB file cannot be
    deleted.

    HTH,
    Nicole


    "Aaron" <kuya789@yahoo. com> wrote in message
    news:b4828959.0 309070036.35e93 392@posting.goo gle.com...[color=blue]
    > Can someone please help me close this db connection. I know the
    > connection is not closed because there;s a ldb file in my db folder.
    >
    > dbCommand.Conne ction.Open();
    > IDataReader myReader = dbCommand.Execu teReader();
    >
    > while (myReader.Read( ))
    > {
    > return myReader.GetStr ing(1);
    > }
    > myReader.Close( );
    > dbCommand.Conne ction.Close();
    >
    > Thanaks[/color]


    Comment

    Working...