473,396 Members | 1,921 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.

row count after row delete

I have a datatable with 10 rows in it, I then delete a row using Row.Delete()

When I display the data table in a grid I see 9 rows but when I do
Rows.Count i get 10 rows?!? how do I get Rows.count do return the correct
number of rows

Thanks in advance

HLPL

Jul 21 '05 #1
3 2045
Hplloyd,

This is strange can you show some (sample) code?

Cor
Jul 21 '05 #2


"hplloyd" wrote:
I have a datatable with 10 rows in it, I then delete a row using Row.Delete()

When I display the data table in a grid I see 9 rows but when I do
Rows.Count i get 10 rows?!? how do I get Rows.count do return the correct
number of rows

Thanks in advance

HLPL

Jul 21 '05 #3
Use the accept changes methode for your dataset (but only after you update
the datasource).
Like this
MyDataAdapter.Update(MyDataTable) or of data set (MyDataSet,"MyDataTable")

For data table
MyDataTable.AcceptChanges

For data set
MyDataSet.Tables("MyDataTable").AcceptChanges

Hope this helps

Steven

this will cause your disconnected datatable (Or dataset) to reflect the
changes that were made to it.
"hplloyd" wrote:
I have a datatable with 10 rows in it, I then delete a row using Row.Delete()

When I display the data table in a grid I see 9 rows but when I do
Rows.Count i get 10 rows?!? how do I get Rows.count do return the correct
number of rows

Thanks in advance

HLPL

Jul 21 '05 #4

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

Similar topics

3
by: phil | last post by:
Using Tkinter Canvas to teach High School Geometry with A LOT of success. My drawing gets very slow after a lot of actions. For instance I have created code to rotate a set of objects about a...
22
by: Joseph Shraibman | last post by:
On a 7.3.4 database: explain analyse select count(*) from elog; Aggregate (cost=223764.05..223764.05 rows=1 width=0) (actual time=81372.11..81372.11 rows=1 loops=1) -> Seq Scan on elog ...
5
by: Terri | last post by:
I have a form with a multi-select combo. I dynamically build a SELECT statement, open a report, and set the recordsource to my dynamic SELECT statement. I count the records returned in the report...
14
by: Ron James | last post by:
C++ is a great language. You can instantiate an object on the stack, grab whatever resources you need, and free them in the destructor. Object destructors are called in the correct order (the...
8
by: novus | last post by:
Hi, In ASP.net 2.0 I make a control which add the same controls dynamically. In the oninit event I add the controls to the controls collection. After that the loadviewstate event fills in the...
1
by: rsbutterfly16 via AccessMonster.com | last post by:
hi guys i have form with a listbox . The listbox is coming from a query that gets all passengers(column 1 in listbox) and destinations(column 3) . so you have repeting rows of passengers since...
1
by: michael.martinek | last post by:
Greetings! I've recently been trying to do something, which apparently looks like it may be a little odd.. I'm not finding anything in the manuals or anywhere on the web where something similiar...
1
by: danibecr | last post by:
I'm trying to make a table that will daily count the records imported and save them to a seperate table along with the date imported. But as of now after all the processing is complete I delete...
7
kcdoell
by: kcdoell | last post by:
Good Morning World: I have written the following code: 'Gives the user to delete and replace all records for a specified parameter LockSQL = "SELECT * FROM tblStaticAllForecast WHERE" & _...
3
by: Hasse1982 | last post by:
Hi I have a table KDOCUMENT with the columns , , , , , ,
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.