locked
Concurrency violation RRS feed

  • Question

  • Hi, I am currently trying to connect vb.net to mysql. I have the following code however it doesn't work properly. It shows the data from the database however the commands fail to work correctly. I get the error "Concurrency violation: the DeleteCommand affected 0 of the expected 1 records."

    The code can be seen here:

    http://pastebin.com/0aRPZfC7

    Thanks for your help! 

    Tuesday, February 15, 2011 12:05 PM

Answers

  • Now got this working no idea what I did, but seeing as though I only have 4 hours left of sleeping time until I have to go to Sixth Form tomorrow I don't care!

    See code here:

    http://pastebin.com/dPiMfcUz

    • Proposed as answer by Jackie-Sun Wednesday, February 23, 2011 8:38 AM
    • Marked as answer by Jackie-Sun Wednesday, February 23, 2011 8:42 AM
    Wednesday, February 16, 2011 12:44 AM

All replies

  • I would try removing the size argument (5) for your PatientID parameter. It's numeric and should not be required.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Tuesday, February 15, 2011 7:20 PM
  • Thank you very much for your reply, I'm quite new to this so unsure on how to do that :P

    I've now got a new error "Cannot find data table 0"

    Here is my new code:

    http://pastebin.com/HjGJruza

     

    Thank you so much for your reply, me getting this code working is riding on my computing project which gets me into university! 

    Tuesday, February 15, 2011 11:57 PM
  • Now got this working no idea what I did, but seeing as though I only have 4 hours left of sleeping time until I have to go to Sixth Form tomorrow I don't care!

    See code here:

    http://pastebin.com/dPiMfcUz

    • Proposed as answer by Jackie-Sun Wednesday, February 23, 2011 8:38 AM
    • Marked as answer by Jackie-Sun Wednesday, February 23, 2011 8:42 AM
    Wednesday, February 16, 2011 12:44 AM
  • Hello willd1,

     

    Thanks for your feedback, I just found a same error solved in VB.NET Forum. Please see this thread:

    http://www.vbforums.com/showthread.php?referrerid=61394&t=509102

    Hopr it can help you,


    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 21, 2011 8:54 AM