نمایش نتایج 1 تا 40 از 534

نام تاپیک: 1001 نکته در سی شارپ

Threaded View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #7
    کاربر دائمی آواتار saeed-kh
    تاریخ عضویت
    مهر 1387
    محل زندگی
    مازندران - بابل
    پست
    148

    حل مشکل خطای Concurrency violation

    پست های زیادی این مشکل را مطرح کردند.آخرشم تو این سایت به جواب نرسیدم.
    لازم دیدم نتیجه رو اینجا برای دوستانم بزارم.

    concurrency violation the updatecommand affected 0 of the expected 1 records



    به قسمت TableAdapter در Dataset بروید.
    دستورات مربوط به Update , Delete را اصلاح کنید. به این صورت که در قسمت Where فقط شرط مربوط به کلید را باقی گذاشته و بقیه شروط را حذف کنید.

    Syed Sami Naushahi
    1. Open the DataSet in the designer.
    2. Click on the adapter portion of the relevant table. For example in my case I clicked on DoctorTableAdopter.
    3. The properties window will show the UpdateCommand and DeleteCommand for this adopter.
    4. Expand Update and Delete commands by clicking the + sign on their left. This would show the CommandText property for these commands.
    5. Click on the value entered against CommandText. It will show you the SQL statement for that command. Edit its WHERE clause and remove all other columns except the columns included in your primary key. For example in my case a rather lengthy WHERE clause (which was trying to compare more than a dozen columns) was modified to WHERE (Doctor_ID = @Original_Doctor_ID).
    منبع:MSDN.com
    آخرین ویرایش به وسیله Mahmoud.Afrad : جمعه 30 خرداد 1393 در 12:43 عصر

برچسب های این تاپیک

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •