Re: VB ADO.NET Concurrency, Access, date fields and parameters
From: Soop (google.10.soop_at_spamgourmet.com)
Date: 05/18/04
- Next message: Patrice: "Re: Connections are pooled but not reused"
- Previous message: Herman Lammers: "autoincrement"
- In reply to: William Ryan eMVP: "Re: VB ADO.NET Concurrency, Access, date fields and parameters"
- Next in thread: Soop: "Re: VB ADO.NET Concurrency, Access, date fields and parameters"
- Messages sorted by: [ date ] [ thread ]
Date: 18 May 2004 01:10:27 -0700
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message news:<#4n6z$CPEHA.2976@TK2MSFTNGP10.phx.gbl>...
> Hi Soop:
Hi Bill, thank you very much for your help, it is much apreciated.
> "Soop" <google.10.soop@spamgourmet.com> wrote in message
> news:9c313518.0405170822.40baf313@posting.google.com...
> > I am having lots of problems with an Access DB and updating datasets
> > with date fields. Even on a very simple test DB of just ID & date
> > fields, I get a "Concurrency violation" when upding the data source
> > after changing the data from a datagrid.
> >
> > I bind a datagrid to the dataset and populate the grid by a
> > dataAdaptor.fill
> > I then edit a date in the grid.
> > Then I update the data source using dataAdaptor.Update
> > That is the point I get my Concurrency Violation.
> > If I remove all Date fields from the database, I have no errors when
> > adding, deleting or updating records.
>
> Not sure what your update command looks like but that's the likely source.
> Are you using a CommandBuilder, DataAdapterConfiguration Wizard or did you
> write your own logic?
In my original code I am using the DACW to generate the code and then
I modify it to suit my runtime dataset creation etc. I can post this
if it may help but...
I have set up a test project with a grid bound to my dataset. That has
all been generated at design time by the DACW and not edited. I have
an access DB with 3 fields tmp_id(autonumber), tmp_date(date/time) and
tmp_name(text). I have added 1 record to the db from within Access.
When I edit that record from the grid, the ad.update fails with the
concurrency invalid error.
Would it be helpful to post the update command? I assumed that the
DACW would get it right for me :)
> >
> > My question is, does anyone know of a way to see the actual sql
> > command that is being run on each datasource row update? I mean with
> > the parameters replaced so I can see what values are acutally being
> > inserted?
> You can add a handler for RowUpdating on the DataAdapter and you can discern
> what you need from there.
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataOleDbOleDbDataAdapterClassTopic.asp
> There's no profiler that I konw of for Access, but if you ever use SQL
> Server you can use the SQL Profiler to see the exact text being sent back.
That's just what I needed thank you Bill. I had seen people around on
the Net with output from a profiler and couldnt find one myself, that
explains why!
I will attempt to get the actual sql string in the RowUpading event.
At this time, I would simply like to see a simple project using grids
and dates with an access db! It surely cant all be this hard ;)
Many thanks again.
>
> HTH,
>
> Bill
>
> www.devbuzz.com
> www.knowdotnet.com
>
>
> >
> > Any help very much appreciated.
> >
> > Thanks
- Next message: Patrice: "Re: Connections are pooled but not reused"
- Previous message: Herman Lammers: "autoincrement"
- In reply to: William Ryan eMVP: "Re: VB ADO.NET Concurrency, Access, date fields and parameters"
- Next in thread: Soop: "Re: VB ADO.NET Concurrency, Access, date fields and parameters"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|