Solved

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

Posted on 2006-07-21
4
275 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 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

14 Experts available now in Live!

Get 1:1 Help Now