Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Concurrency violation?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00895348
Message ID:
00895604
Vues:
17
Thank you for putting up with me and my posts...
Sometimes these things just get the better of me!

I took the code from my sample app, that we got working yesterday, and updated my real app.
It worked too.
Then I modified it and it didn't work...
but I don't understand why...

The modification that made it not work, which produced a Concurrency violation, was code I placed at the top of my save code...
'--------------------------
' Create the UpdateCommand.
'--------------------------
oledbCMD = New OleDbCommand("UPDATE Contacts SET " & _
                                    "Company= ? " & _
                                    "WHERE Unique_ID = ?", oledbConn)

oledbCMD.Parameters.Add("@Unique_ID", OleDbType.Integer, 32, "Unique_ID")
oledbCMD.Parameters.Add("@Company", OleDbType.Char, 50, "Company")

oledbDA.UpdateCommand = oledbCMD
When I comment out this code, my save works again.

My intention was to have the definition of my update in the same section that would be performing the update. I have a definition of my update in my form load...
am I not allowed to redefine my update?
or is it that I can't redefine the update in the sub that executes the update?
(I tried putting it in a sepparate routine and that didn't work either)
or is it a timing issue (the redefinition is not finished before the code to execute it fires)?
or ????

My intention was to have the definition of my update in the same section that would be performing the update. I wanted to do this because I actually have several places where different portions of my contact table are displayed and allowed to be edited. I wanted unique save code for each section, saving only the fields associated with that section...
(is that a flawed approach?)
or should I have just one save code which processes all the fields of the Contacts table?

As you know, I'm new to this (VB.Net) and I'm still trying (and willing) to learn.

Rick

>Working with VB.Net is becoming an adventure.
>I'm the only person using the system. I closed the app and started over. I edited two text fields that I saved edits to before... and now I get the Concurrency Violation.
>
>I'm using an Access table.
>It's rights and the user's rights allow me to modify the table...
>Any insights would be greatly appreciated.
>
>Rick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform