Solved

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

Posted on 2006-07-21
4
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 Winforms Signing 13 42
Header Font Size in Grid View 6 27
Build a string of emails from a gridview 2 18
Stop Git from being my repository 1 25
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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