473,288 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

Use optimistic concurrency

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.
Dec 21 '05 #1
2 2166
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
Dec 21 '05 #2
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

Dec 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Huddle | last post by:
Is there a way to turn off optimistic concurrency in ASP.NET when updating a record via the oleDBdataAdapter/oleDBcommandBuilder? If you use the Microsoft ASP.NET tools you can turn it off and...
8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
2
by: stuart.d.jones | last post by:
Hi, I'm using a detailsview control with an SqlDataSource control. My Update query isn't working, and I've narrowed it down to the optimistic concurrency parameters - i.e. when I comment them...
0
by: russganz | last post by:
It seems to me there are real problems with the datagridview (along with the detailsview and form view) control when using optimistic concurrency with fields that can be null. Trying to use these...
6
by: shaanxxx | last post by:
I have global variable which is being shared between threads (problem is not connected with thread). Without using any mutex i have do some operation global variable in *consistent* way. ...
4
by: Andrew Robinson | last post by:
I am working on a system system that requires optimistic concurrency within a web app. At first I thought this would be easy. We generate our own entities and dal/service layer but I now see that...
1
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I was suddenly told to whip up a web project in ASP.Net 2.0. The last few weeks have been a crash course in new technology. I've done some 1.1 web work but it's been a while. The basics are...
1
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
(If I'm overlooking anything, please let me know.) First, my only concern is updating single records in a Detailsview using an ObjectDataSource. The target table has a timestamp field. Assume ...
8
by: Roger.Noreply | last post by:
Hi, Sql-Server 2000, 2005. A report fetches a lot of rows using the "WITH (ROWLOCK)" syntax (the sql is generated on the fly by a tool and not easily changeable). SELECT col1, col2 FROM mytab...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.