Solved

Clearing rows from the datagrid

Posted on 2002-06-05
6
168 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month6 days, 7 hours left to enroll

634 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