473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Clear data in DataGridView

Hello all
I've been trying to do a little project here and i am stuck at the
point where I can not clear the data out of datagridview table. I've done
lots of reading from different sources on internet. Most of the suggestion
is put this line of code in DataGridView1.Rows.Clear() < This line
never work and if give me and ArgumentException Error. Could any one please
help me out. I am using vb 2005. Thanks
HN

Aug 16 '07 #1
1 10832
Huy,

A datagridview is normally accessed by its underlying datatable. If you
clean that than it is empty. Or even more simple.

DataGridView1.datasource = nothing

Cor

"Huy Nguyen" <HN*****@gcprestress.localschreef in bericht
news:4D**********************************@microsof t.com...
Hello all
I've been trying to do a little project here and i am stuck at the
point where I can not clear the data out of datagridview table. I've done
lots of reading from different sources on internet. Most of the suggestion
is put this line of code in DataGridView1.Rows.Clear() < This line
never work and if give me and ArgumentException Error. Could any one
please help me out. I am using vb 2005. Thanks
HN
Aug 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Henry J. | last post by:
When the user loads the data into a DataGridView, some error icons may be shown to indicate some errors like when uniqueness is violated. The user can go ahead modifying the data rows. Once the...
2
by: Ivan | last post by:
I have a class Foo which have two property. I have a thread that do some process and update class Foo int B. I have a datagridview on main form. this datagridview data source to this class Foo and...
2
by: Rick Shaw | last post by:
Hi, I have a problem with the datagridview not refreshed when the application first appear on the screen. The datagridview display data from a table in the dataset. At the same time, I've added...
0
by: David Mayerovitch | last post by:
As an exercise in learning Visual Basic 2005, I am putting together a simple XML editor. I place on the form the objects DataGridView1 and DataSet1. ' Read an XML file into DataSet1:...
6
by: Bill Nguyen | last post by:
I tried almost everything ..Rows.clear() ..rowcount = 0 and the rows in a datagridview still not cleared I populated the Datagridview manually using Row.Add Any help is greatly appreciated ...
2
by: ysidro | last post by:
this is maby a answer and not a discussion. I saw many questions about how to clear an unbound datagrid in C#. Here is de ansuer: " dataGridView1.Rows.Clear(); "//clear or delete all columns in...
4
by: rdubus | last post by:
After I have filled my datagridview I want to clear it up when the options for the query changes. I know how to clear the fields but I don't know how to clear the rows, so the datagridview appears...
2
by: cameljs18 | last post by:
I have a datatable into which i insert data then display the data in a datagridview.When i want to clear the table and place completely new data in the table, the table still retains the column...
0
by: Flupke | last post by:
Hello All, In a VB2005 Application, I want at a certain point clear the contents of a datagridview, but maintain the columnheaders on the datagrid itself so that it is obvious that the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.