How to override Sql statement used by tableadapter to do updates

Posted on 2007-10-18
Last Modified: 2008-01-09
I am having issues with dbconcurrency exceptions, and I understand that a potential fix for this is to manually construct my update sql statements, rather than using the ones generated by

How do I go about doing this?  

I know how to create the update SQL statement for the current record in view, but it is possible to override the sql statement that will  be used when asking the tableadapter to update all the changes, as in

MyTableAdapter.Update( MyDataSet.MyTable)
Question by:hertzgordman
    LVL 21

    Expert Comment

    Have you tried playing with MyTableAdapter.UpdateCommand before doing a MyTableAdapter.Update() ??
    LVL 1

    Accepted Solution

    try going on the data sources tab(for me is located next to the solution explorer tab) then right click your db and chose edit dataset with designer. that will open datase.xsd for you.if you click on the tableadapter table check the properties menu and find YpdateCommand. You can continue and set it to whatever you want from there. Everytime you call update after that it will use your command.

    hope I helped :)

    Author Comment

    thanks will try it out...

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now