Rodney
Rodney

Reputation: 11

TableAdapterManager does not contain "table adapter" and no extension method

I created a simple form that uses a typed dataset generated by Visual Studio (Express to be exact).

I altered the default "Fill" query to pull in values from a few other tables and then tried to run my application and got the following error:

TableAdapterManager does not contain "table adapter" and no extension method

Prior to my changes everything worked fine. Even after undoing my query changes I still got the same error.

How do I fix this?

Thanks in advance.

Upvotes: 1

Views: 8673

Answers (4)

malik niaz
malik niaz

Reputation: 1

This error is given mostly because sometimes you have created a DataTable and DataTableAdapater with Generate Insert, Update and Delete statement in the Advanced Options button. However, you remove the option for Generate Insert, Update and Delete statement.

The solution is either re-enable this option or remove all its references. Re-enabling this option worked for me.

enter image description here

Upvotes: 0

Dennis
Dennis

Reputation: 51

It's an old question, but I will still give an answer: instead of editing the query for select, add a new select query where you can join tables, etc. Then TableAdapterManager will be able to generate the code. The new query will add a new method to fill the dataset (FillBy()), use this method instead off Fill() that will still use the old query. I had the same error and this solution worked for me.

Upvotes: 1

user4559494
user4559494

Reputation:

I had recently a similar problem, I detailed the situation I had. The problem probably cames from that your new fill method can not generate the respectively insert, update, delete commands. If the TA does not have this commands, the Table Adapter will not have the update option, so the Table Adapter Manager will not have a property for it. I solved it using "Configure" with the TA and then

Upvotes: 0

Mircea Ion
Mircea Ion

Reputation: 698

From what I know the TableAdapterManager has a property for each TableAdapter that you defined in your DataSet.xsd. However they are null to begin with so, after you create an instance of the TAM you are responsible to "write some code" and "populate those properties" with instances of the corresponding table adapters.

Plus you would have to set the connection which will override any connections your adapter may individually have.

You may want to read here TableAdapterManager overview thoroughly before using the TableAdapterManager.

Upvotes: 1

Related Questions