|
-
May 24th, 2003, 05:21 AM
#1
Thread Starter
Hyperactive Member
It seems absurd... (DB question)
But I can't get an error . Yes, I want the DBConcurrency error, but I can't get it! When I establish two different connection with a database, make the same query, modify the data with different values and try to update, I get no error.
Why? Are the two different connections?
Help, please... Thx
Learn, this is the Keyword...
-
May 24th, 2003, 11:56 AM
#2
Frenzied Member
Did you add the dataadapter at desing time? if so did you checked 'Use Optimistic Concurrency' ?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
May 24th, 2003, 01:20 PM
#3
Frenzied Member
Do this. Start the program twice, then get the data from both programs. Change and update one program, then change and update the second program. You should get an error. I did a project to produce a DBConcurrency exception, and I did it like the above.
-
May 25th, 2003, 03:26 AM
#4
Thread Starter
Hyperactive Member
I did this:
VB Code:
dim Da1 as OleDbDataAdapter
dim Da2 as oleDbDataAdapter
dim ds1 as DataSet
dim ds2 as DataSet
Da1 = New OleDbDataAdapter(TheSameQuery, myConnection)
Da2 = New OleDbDataAdapter(TheSameQuery, myConnection)
Da1.Fill(ds1,mytable)
Da2.Fill(ds2,mytable)
ds1.tables(0).rows(0)(0)=10
ds2.tables(0).rows(0)(0)=15
da1.Update(ds1,mytable)
da2.update(ds2,mytable) ' Here's where I GET the error
In the code above I GET the error, but since I'm remoting this object, I can't use these lines don't know why:
VB Code:
Da1 = New OleDbDataAdapter(TheSameQuery, myConnection)
Da2 = New OleDbDataAdapter(TheSameQuery, myConnection)
To make it working I had to change in:
VB Code:
Da1 = New OleDbDataAdapter(TheSameQuery, myConnectionString) 'Instead of myConnection
Da2 = New OleDbDataAdapter(TheSameQuery, myConnectionString) 'Instead of myConnection
Now I DON'T GET the error... Please try...
Learn, this is the Keyword...
-
May 26th, 2003, 08:52 AM
#5
Thread Starter
Hyperactive Member
Learn, this is the Keyword...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|