Jamie Butterworth
Jamie Butterworth

Reputation: 607

Deleting Table Adapter from Dataset

I've added a table adapter in the dataset xsd file (by right-clicking inside the diagram and adding a table adpater) and I want to delete it entirely from the project (with the intention of re-adding it after making a change in the database). I've right-clicked the table adapter in the xsd and clicked Delete but this just removes the table adapter visually from the diagram.

As a result, there is code, related to the table adapter, in these files: [dataset].Designer.vb [dataset].xss

Is there a way to delete the table adapter entirely from the project, i.e. from the xsd and the designer file?

I've tried removing the table adapter and running the custom tool but this hasn't removed the code.

When I re-add the table adapter, its name is appended with a "1" and I believe this is because there's still trace of the original table in the project.

Upvotes: 0

Views: 471

Answers (1)

Jamie Butterworth
Jamie Butterworth

Reputation: 607

Awkwardly answering my own question thanks to this answer: Weird "Designer1.cs" files created

I had to delete the table adapter from the diagram, save, close VS, delete the designer file with File Explorer, reopen VS and run the custom tool against the xsd. This regenerates the designer file so it no longer contains the table adapter.

Re-adding the table adapter, saving and then running the custom tool updates the designer file by adding the new table adapter to it.

Upvotes: 0

Related Questions