Solved

Where's my data???  (MS ACCESS, OLE DB, DataGrid)

Posted on 2006-07-21
4
271 Views
Last Modified: 2010-04-16
1.  I have a DataGrid.  
2.  I have a Form.
3.  I have an Access DB.
4.  I have a dataset.

The Form data is inserted into my DB in an isolated transaction.

After that transaction has completed, I reload my dataset which is binded to the DataGrid.  I use a  connection instance for me insert transaction, and another connection object for my "selects".  Even though both connection objects are created from the same connection string (appended below), the data seems to not be updated with a follow up my completed transaction with a search on the newly inserted data.

Basically the data I'm submitting is not show up in my datagrid.  It's like I have to wait a few seconds and search again to find it.  Is Access really that slow.  Why would it complete my insert and transaction if it's not done.




Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=$$$\DocuBase.mdb;Mode=Share Deny None;Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False
0
Comment
Question by:Tertioptus
  • 2
4 Comments
 
LVL 6

Expert Comment

by:NunoGodinho
ID: 17158630
Hi,

   Are you explicitly commiting the transaction? that could be the problem.
0
 
LVL 1

Accepted Solution

by:
flashaoy earned 500 total points
ID: 17159846
You'll have to use one instnce troughout your app(or form) of the adapter(adp1) and assosiated connection(con) when selecting, inserting, deleteing and updateing of the dataset(ds) if you want the data to be concurrent within your grid and reflect changes as it happens. The concurrency behind the dataset & grid are maintained by currencymanagers and currency happens 'automaticlly', but you'll have to use the original instances of dataset, adapter, commands and connections objects to preserve currency of the datasets and keep them in context of its original 'data factories'.

If you have 2 adapter; one for selecting and one for insetingon the same dataset table, you will have concurrency problems. Rember that the adapter knows the states of the rows during an fill or update - the adapter only gets/changes the rows whos states has changed and/or are different as those rows in the db.

you should buy a book explaning these stuff to you. Datasets are very powerfull, but they can irretate the hell out of you if you use it the wrong way.
0
 
LVL 5

Author Comment

by:Tertioptus
ID: 17167167
Oui, oui, Nuno
0
 
LVL 5

Author Comment

by:Tertioptus
ID: 17171162
Just needed to maintain one connection object.  Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

862 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now