PC Review


Reply
Thread Tools Rate Thread

Use optimistic concurrency

 
 
=?Utf-8?B?Sm9obg==?=
Guest
Posts: n/a
 
      21st Dec 2005
In 'Data Adapter Configuration Wizard' for OleDbDataAdapter, there's a
checkbox called 'Use optimistic concurrency' that allows to turn on/off the
option. I don't use the wizard, I create MyDataAdapter using the following,
MyDataAdapter = new New OleDbDataAdapter(MySql, MyDatabase)
The question is how to turn off the 'Use optimistic concurrency' option in
my case. Thanks.
 
Reply With Quote
 
 
 
 
Chris
Guest
Posts: n/a
 
      21st Dec 2005
John wrote:
> In 'Data Adapter Configuration Wizard' for OleDbDataAdapter, there's a
> checkbox called 'Use optimistic concurrency' that allows to turn on/off the
> option. I don't use the wizard, I create MyDataAdapter using the following,
> MyDataAdapter = new New OleDbDataAdapter(MySql, MyDatabase)
> The question is how to turn off the 'Use optimistic concurrency' option in
> my case. Thanks.


Not too sure myself, but if you look at the code the wizard creates when
you use the wizard it will show you how it does it. The code will be in
the "windows generated area" Remember, the wizard just dumps in code,
there is no hidden magic under it.

Chris
 
Reply With Quote
 
=?Utf-8?B?Sm9obg==?=
Guest
Posts: n/a
 
      21st Dec 2005
Thanks, Chris.

The only difference I can see is the WHERE clause in the UPDATE statement.
With the option checked, the WHERE clause is very long, and with the option
unchecked, there's only one field included in the WHERE clause.

I create my UPDATE statement using the following,
MyDataAdapter.UpdateCommand = cmdBuilder.GetUpdateCommand()
and it has a long WHERE clause. I wish I can have a short WHERE clause that
only checks the PK field and that's just like the one the wizard createed
with the open turned off.

The long WHERE clause catches "Concurrency violation" exception which I
realy don't care at this moment.

Thanks.


"Chris" wrote:

> John wrote:
> > In 'Data Adapter Configuration Wizard' for OleDbDataAdapter, there's a
> > checkbox called 'Use optimistic concurrency' that allows to turn on/off the
> > option. I don't use the wizard, I create MyDataAdapter using the following,
> > MyDataAdapter = new New OleDbDataAdapter(MySql, MyDatabase)
> > The question is how to turn off the 'Use optimistic concurrency' option in
> > my case. Thanks.

>
> Not too sure myself, but if you look at the code the wizard creates when
> you use the wizard it will show you how it does it. The code will be in
> the "windows generated area" Remember, the wizard just dumps in code,
> there is no hidden magic under it.
>
> Chris
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimistic Concurrency Laurahn Microsoft ADO .NET 3 12th Sep 2007 01:53 PM
Optimistic Concurrency - how? - net 2.0 Rolf Welskes Microsoft ADO .NET 7 17th May 2007 02:45 AM
Optimistic Concurrency =?Utf-8?B?TGFycnkgQ2hhcmx0b24=?= Microsoft ADO .NET 2 29th Mar 2006 12:02 PM
Optimistic Concurrency Viktor Zadro Microsoft ADO .NET 2 6th Apr 2004 04:11 PM
optimistic concurrency Brad Williams Microsoft ADO .NET 15 8th Jan 2004 01:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:09 PM.