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 7092027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:15:41+00:00 2026-05-28T08:15:41+00:00

I am using the C# VS2010 TableAdapter Wizard for my project to interface with

  • 0

I am using the C# VS2010 TableAdapter Wizard for my project to interface with my db. I have generated my own Insert, Update and Delete commands for this adapter since it uses a join and can not generate its own. I’m okay with that, but unfortunately when I created the Insert command I am not able to call the “Insert()” method on the tableadapter. The other methods are working fine.

For example,

`this.joinTableAdapter = new MyTableAdapter();

this.joinTableAdapter.Insert() <– does not exist.`

It was my understanding that once you create a valid insert command that this method should become visible on the table adapter. Am I mistaken about this? It is working for my update and delete command. Any ideas what I am doing wrong?

Any help is appreciated. Thanks everyone!

  • 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-05-28T08:15:42+00:00Added an answer on May 28, 2026 at 8:15 am

    TableAdapter GenerateDbDirectMethods

    In addition to the InsertCommand, UpdateCommand, and DeleteCommand, TableAdapters are created with methods that can be executed directly against the database. These methods (TableAdapter.Insert, TableAdapter.Update, and TableAdapter.Delete) can be called directly to manipulate data in the database.

    If you do not want to create these direct methods, set the TableAdapter’s GenerateDbDirectMethods property to false (in the Properties window). Additional queries added to the TableAdapter are standalone queries — they do not generate these methods.

    You’ll find this option at the designer in the second last page.
    Create methods to send updates directly to the database

    • http://msdn.microsoft.com/en-us/library/dex7k4dw%28v=vs.100%29.aspx
    • http://msdn.microsoft.com/en-us/library/bz9tthwx%28v=vs.100%29.aspx

    Note: This is not the same then clicking Advanced Options and click:

    Generate Insert, Update, and Delete statements

    When you select this option, the wizard will attempt to generate INSERT, UPDATE, and DELETE statements based on the SELECT statement defined on the Generate SQL statements page.


    Edit:

    The TableAdapter cannot create insert,update and delete statements automatically when more than one table is involved in the main select query. There are several approaches if you need one or more columns of related tables, the best way depends on your requirement.

    1. Add insert,update and delete queries manually to the TableAdapter. These methods can be called directly from an instance of the TableAdapter(f.e. InsertUser(param1,param2))
    2. Add insert,update and delete commands manually to the TableAdapter(designer or programmatically). These commands will be triggered implicitely from the TableAdapter when you call Update. The DataRow’s RowState determines which command will be triggered(f.e. Added->InsertCommand).
    3. Select one table and join the tables via relations to other tables in the DataSet

    For the third approach you could use LINQ-To-DataSet to join the related tables to get all needed columns(f.e. to create a DataSource for a GridView).

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

Sidebar

Related Questions

I have created a DeclarativeServiceLibrary using VS2010 beta 2, Please check this image of
I have this code written in .NET 4.0 using VS2010 Ultimate Beta 2: smtpClient.Send(mailMsg);
Using VS2010, .NET4.0, MVC3, EF4.1 Code-First I have this POCO entities: public class XBLContent
I am using VS2010 premium, and I have a database project in my solution.
I am using VS2010 and am working with this project. http://www.codeproject.com/KB/audio-video/Asio_Net.aspx Initially, I downloaded
I'm using VS2010 with Resharper 5.1. I have two projects, a library project (Lib)
Using VS2010 and .NET 4 what exactly does the ADO.NET EF wizard update when
I'm using VS2010 Beta 2, I have a Complex Type called Address with the
I'm using MVC2 with VS2010 I have a view that has two partial views
I have installed VS2010 and MVC2 and testing a simple form using tinyMCE. When

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.