Major update problem

  • Thread starter Thread starter Wortelvisje
  • Start date Start date
W

Wortelvisje

Hello,



I'm using ado.net for the first time, so it can be the answer is quit easy:
I'm using an access database, witch access data in the same table on
different forms by means of a dataset. If I do a update on one form, the
changes are not visible in the other form, even if I re-query. I'm sure the
db has changed, because if I restart the program, everything is ok. I'm
using VB.net, with insert and update commands.



So

- is their a way to make sure your changes are written immediately in the db
(ms access db)

- or if you re-query how can you make sure all changes have been done?



greetz

Nelis
 
Yes, submit the DataAdapter.update after each change which
you know about via the control's events.

Once the data is changed in the DB, which you have
confirmed, if you rebind the data, it should be
reflected. Similarly, and changes made locally should
reflect immediatley unless you use two seperate datatables
on different forms. If you only fill one datatable, and
different forms reference it, they all should show the
same thing. But if you use a different table for the same
query, one table won't know of the other's changes....

So re-query and rebind the data. That should do it for
you.

Let me knwo if you have any questions.....ADO.NET is a
much different way of thinking from the old days, but it's
well worth it.

Cheers,

Bill

W.G. Ryan
(e-mail address removed)
www.knowdotnet.com
 
First, thanks for your answer, this is a quit annoying problem! I followed
your advice and just to test I've written a timer to refresh every second,
but it takes several seconds before the changes are in the db! It's just
horrible; it makes the JET engine really unusable for any practical program
to update data!

Maybe transactions can help, although I have to figure out how to use them
first. And if that does affect performance its not really a good solution
after al.

Btw, the solution with the adapter.update method doesn't work, because I use
a insert command, not a dataset a do adapt



greetz
 
Well, don't say I didn't warn you. ;)
Most folks find that JET is fine for smaller applications (and it works well
in single-user mode in Access) but it gets in trouble when pressed into
"serious" high throughput or multi-user tasks. This is why MSDE is replacing
it in many situations.
Before you throw out the application data access interface and start over, I
suggest checking out the Transaction approach and visit the
microsoft.public.data.ado list where Roy Fine hangs out. He's a lot smarter
on Jet that I and might have some other suggestions.

hth

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
To late already, its MSDE now, and it will stay like that! The whole program
is working fine now, except....Installing. How can in an easy way install
the database for the MSDE application. Its not an issue to install the MSDE,
that's no problem, its detecting where the server is (to change al my
connection components) and loading in the db (possible with create
commands??, does their have to be a db on that moment? or is a connection
enough?)



thx for your help anyway, MSDE is a lot faster to even if you have only 2
users.

greetz
 
I wrote an article (some time back) that talks about how to use SQL DMO to
do most of what you want.
As far as identifying the host MSDE, you might try "." as the server name
but this assumes there's only one instance installed. What you need to do is
install a uniquely named instance on the system and use that name in the
ConnectString. Installing the DB can be done with a SQL DMO command or using
OSQL sp_attach_db command. (The article discusses this).

See http://www.betav.com/sql_server_magazine.htm

hth

--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top