VB.NET - OleDBException when trying to use the fill method on a dataset
Results 1 to 4 of 4

Thread: VB.NET - OleDBException when trying to use the fill method on a dataset

  1. #1
    Registered User 10of40's Avatar
    Join Date
    Aug 2002
    Location
    Unimatrix W-2
    Posts
    78

    VB.NET - OleDBException when trying to use the fill method on a dataset

    Code:
    Dim nwindConn As OdbcConnection = New OdbcConnection("Driver={SQL Server};Server=localhost;" & "Trusted_Connection=yes;Database=northwind")
    
    Dim selectCMD As OdbcCommand = New OdbcCommand("SELECT CustomerID, CompanyName FROM Customers", nwindConn)
    selectCMD.CommandTimeout = 30
    
    Dim custDA As OdbcDataAdapter = New OdbcDataAdapter
    custDA.SelectCommand = selectCMD
    
    nwindConn.Open()
    
    Dim custDS As DataSet = New DataSet
    custDA.Fill(custDS, "Customers")
    
    nwindConn.Close()
    This code (only the names and connection string changed), for some reason, is throwing an OleDBException.
    "I aspire sir, to be better than I am." -- Data, Star Trek: Nemesis

  2. #2
    Registered User 10of40's Avatar
    Join Date
    Aug 2002
    Location
    Unimatrix W-2
    Posts
    78
    I did some more digging, and the description of the exception is the "IErrorInfo.GetDescription failed with E_FAIL(0x80004005)", which I figure is compilerspeak for "you're hosed but I have no clue why"

    The SQL statement in question is "SELECT * FROM <tablename>" It seems to only fail on a particular table in the database.

    EDIT: Nevermind - the table itself was hosed. Copying data to a new table fixed the issue.
    Last edited by 10of40; July 12th, 2005 at 01:24 PM.
    "I aspire sir, to be better than I am." -- Data, Star Trek: Nemesis

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    1
    Hi,

    even though it passed a long time since the last post, the information might still be helpfull.

    I also had this problem in some ocasions and I solved it by reseting IIS. The cause could have been an error while processing the page and the Access DB or table got locked, I'm not sure.

    By reseting IIS all the resources that were in use were freed, the DB was queried and the results displayed properly.

    One thing to pay attention is that it is not enough, at least it was not in my case, to stop and start IIS by using the buttons in the IIS Administration window. This actions only stops and starts (I know, just like the name says ) but doesn't reset it.

    To reset the IIS, I used the following:
    Select Start/run and in the text area type iisreset which will open a DOS window and display a couple of lines describing what is happening.

    After IIS was shutdown and restarted the problem should be solved.

    I hope it helps.


    ----------------------
    http://www.webdp.net

  4. #4
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    Welcome to Windrivers jms and thanks for the tip.
    Never, ever approach a computer saying or even thinking "I will just do this quickly."

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •