when update database, i must wait few second!

T

Tark Siala

hi
i'm using VS.NET 2005 +SP1 C#, and i connect access database by ADO.NET 2.0.
i'm using Dataset to (insert,update,delete) and in get data i use
(Datareader), but my problem when i do this:
1 - insert data (by dataset).
2- get data (by datareader).
when i run this commands i can't get latest data from database, i get data
before insert!!!
but after few second i can get real data after insert, is this problem from
Dataset or Datareader or from Access Database?
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Post your code, your post is not very clear to just give you a solution
based on it.
 
W

William Vaughn

I expect that this is by design. By default JET caches all
updates/deletes/inserts in memory until it has time (idle time) to post the
changes to the database. This improves update performance but means that
data is held in local memory (and only in local memory) for some time. IIRC
you can wrap the operation(s) in a Transaction to get JET to write
immediately on Commit.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
C

Cor Ligthert[MVP]

Tark,

I am very curious why you use the datareader instead of a dataadapter to
fill your datatable.

You are payed by row or something?

Cor
 
W

William Vaughn

Cor, I suggest you leave the comedy to the professionals... ;)

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
C

Cor Ligthert[MVP]

Bill,
Cor, I suggest you leave the comedy to the professionals... ;)
I had to think about this, but what is the comedy in this, I am just
curious?

I don't understand why people want to use methods, where strongly typing is
not even possible, while there are so nice methods available.

My only gues was that it is to create more lines.

Cor
 
T

Tark Siala

thank's.
now i write this lines and its working good:

1 - Fill Dataadapter from Database.
2 - Fill Dataset from Dataadapter.
3 - Update Dataset.
4 - Update Dataadapter from Dataset (to update database).
5 - Fill Dataset from Dataadapter (again to get latest data changes).

Now i get latest data changes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top