472,800 Members | 1,219 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,800 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 2033
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 , , , , , ,
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?

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.