Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9009121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:06:43+00:00 2026-06-16T02:06:43+00:00

My DataAdapter.UpdateCommand calls a stored procedure that does other things beyond just updating the

  • 0

My DataAdapter.UpdateCommand calls a stored procedure that does other things beyond just updating the current record (deleting related records, for example). The rows affected by my stored procedure can be zero because of this, triggering the following error:

Concurrency violation: the UpdateCommand affected 0 of the expected 1 records

I know I can trap the error, but I would prefer to set ADO.Net to not check for concurrency violations in specific cases.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:06:44+00:00Added an answer on June 16, 2026 at 2:06 am

    Here’s a hack I came up with for now. I modified the last statement in my stored procedure to be this:

    --hack to force @@ROWCOUNT to be 1. needed for ado.net concurrency violation check
    DECLARE @Hack BIT; SELECT @Hack = 0;
    

    It makes @@ROWCOUNT 1, but does not return another table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to do transaction control on data access using DataAdapter and Stored Procedure in
I am using ADO.NET (.NET 1.1) in a legacy app. I know that DataAdapter.Fill()
I am executing stored procedure using ExcuteReader() command. If I execute Stored Procedure in
I am facing problem adding and deleting DataRows from a DataTable that is meant
I execute a query that calls a SP, that SP returns data... but when
I made a UpdateCommand for my dataadapter in my MySQL connection. myDataAdapter.UpdateCommand = New
I'm implementing a DataAdapter to bind to a WinJS ListView control. That interface requires
I'm using the DataSet / DataTable / DataAdapter architecture to mediate between the database
I am importing Tables from a Oracle DataBase, using a VB.NET dataAdapter. I use
Within our unit tests we use plain ADO.NET (DataTable, DataAdapter) for preparing the database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.