Solved

Clearing rows from the datagrid

Posted on 2002-06-05
6
166 Views
Last Modified: 2010-05-02
I've been using the datagrid for loading items from the database but I would like to know how to clear all its contents without affecting the table from the database?
0
Comment
Question by:keziah0815
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Accepted Solution

by:
Bahnass earned 70 total points
ID: 7058509
I think
Simply U can't Unless U Unbound it, rebound it by another
Table / Query!!   (even empty one)

this select will select no record

SET mygrid.RecordSource = "SELECT MyTable WHERE FALSE"
0
 

Author Comment

by:keziah0815
ID: 7058530
Thank you very much!It worked!
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 7061361
Dear if It worked!    

WHY GRADE B ????

:-(

This may prevent Experts from helping U again and makes EE users hisitate to get this from PAQ

(if U think it is so simple Q just put only 50 point)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:Faysalnadeem
ID: 8298408
If u r working in bounded mode with dataset then just
use it ds.Clear() method.
0
 

Expert Comment

by:Faysalnadeem
ID: 8298420
If u r working in bounded mode with dataset then just
use it ds.Clear() method (I tried it in C# working ok).
0
 

Expert Comment

by:tssmithdogg
ID: 8769844
Going back to the database is not the best method.

Simply do this:

myGrid.DataSource = Nothing
MyGrid.DataBind()
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

751 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