Solved

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 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