clearing data from data adaptor

Posted on 2005-04-25
Last Modified: 2010-04-23

the objDS.Tables(0).Rows.Count  seems to be accumulating itself instead of giving the count of just the current select.  It gives me the count of all previous selects plus the current one.   How do I clear the loaded data at the end of each while loop?

Here is a simplified view of the code that is running

while something

            strSQL = "SELECT * from sometable where whatever"
            objDA = New SqlClient.SqlDataAdapter(strSQL, conn)

            For intcounter = 0 To objDS.Tables(0).Rows.Count - 1
Question by:unreal400
    LVL 25

    Accepted Solution

    LVL 25

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now