Solved

Clearing rows from the datagrid

Posted on 2002-06-05
6
162 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
6 Comments
 
LVL 3

Accepted Solution

by:
Bahnass earned 70 total points
Comment Utility
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
Comment Utility
Thank you very much!It worked!
0
 
LVL 3

Expert Comment

by:Bahnass
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

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

Expert Comment

by:Faysalnadeem
Comment Utility
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
Comment Utility
Going back to the database is not the best method.

Simply do this:

myGrid.DataSource = Nothing
MyGrid.DataBind()
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 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

6 Experts available now in Live!

Get 1:1 Help Now