Results 1 to 3 of 3

Thread: Problem with Database app slowing down

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Question Problem with Database app slowing down

    Hello Everyone,

    I am having an issue I don't know how to resolve. I am querying a database and making updates as I go along. when I first start the application it runs so fast but after about 5-10 minutes it starts to slow down to a snail's crawl. it's horrible. anyone have any suggestions as to how to prevent this?

    This is a snippet of code:

    m_daDataAdapter = New OleDb.OleDbDataAdapter("Select * From Word_Verse where Word = '" & MakeSQLSafe(strWord) & "' and VersePart = '" & MakeSQLSafe(strTempVerse) & "' and Book = '" & strBook & "'", m_cnADONetConnection)
    m_cbCommandBuilder = New OleDb.OleDbCommandBuilder(m_daDataAdapter)
    m_dtWordVerse.Reset()
    m_daDataAdapter.Fill(m_dtWordVerse)


    Where it's getting stuck or slowing down each time is on this line:
    m_daDataAdapter.Fill(m_dtWordVerse)

    I've tried resetting it but that didn't help I'm not sure what the issue is.

    Any help would be great.

    Thank you

    Mythos

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Problem with Database app slowing down

    Are you doing all this in a loop?
    you should not fill the data adapter in the loop.. Instead fill it once, make your changes and finally call the update method when you are thru with everything to finalize it to the database.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Thumbs up Re: Problem with Database app slowing down

    Yes, I'm doing this in a loop. The reason is that I'm cycling through every word in a text file to index them in a database.

    The file is the King James bible so that I can create a search application.

    now I think I may have resolved my issue. Instead of creating my data table as a global variable I dimed it as a local variable and then after it updates each record I set the variable back to nothing and that seems to have resolved the issue and it's just cruising along now.

    Thanks again for your help.

    Mythos

Posting Permissions

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



Click Here to Expand Forum to Full Width