Cannot add table adapter to datatable

If I have a dataset in my project, and I've added a datatable to it, when I right click on it the option to add a tableadapter is greyed out. It seems as though I have to add a tableadapter to get a datatable with tableadapter connected to it.

What if you already have a datatable in your project and want to add a tableadapter to it
I had a recommendation to install SP1, and I did, but it did not fix the problem. No response since then.



Answer this question

Cannot add table adapter to datatable

  • angelina

    Well, you can always use the DataAdapter instead of the TableAdapter. It amounts to the same thing basically and is not specifically tied-in to your DataTable (which I think is preferable anyway ... I don't believe that a DataSet should know anything about where the data came from).

  • HPD

    Even though we have this new TableAdapter class, doesn't mean we have to use it. I haven't and I don't intend to. In fact, I'm a bit irritated that it automatically gets included in Typed DataSet generation ... unless there's some way to turn that off. I haven't had the chance to research that possibility yet, but it's on my list of things to do.

    As far as the problem with it not working correctly in the IDE, I haven't had a chance to test out you scenario myself, so I can't say what the problem might be. If I get the chance to play with it, I will, but in the meantime perhaps an MS person might tell us whether or not this is bug.



  • Riady

    You can add a table to a typed dataset without a table adapter easily. Just right click on your dataset Add->DataTable. I don't like what they did with the designer either. You used to be able to see all of the column types right next to the datatable itself. Now you have to select each column and change the type using the properties page.

    Sometimes it seems like the only thing that MS does when they come up with a new technology is write one "Hello World" app. This new TableAdapter is a great idea, but as you said, it does not belong with the dataset. It's as if a novice programmer came up with the idea. What ever happened to data separation

    Of course, no MS response to whether or not this is a bug either.


  • dsula

    >>You can add a table to a typed dataset without a table adapter easily. Just right click on your dataset Add->DataTable<<

    Hmmm ... I had run into an issue awhile back where the Table Adapter was automatically generated with the Typed DataSet Generator, but now I'm not seeing that happen. Weird. I'll have to figure out what that was all about. OK, so forget that rant.

    As far as the DataSet designer goes, I never use it anyway. I prefer to do it all in the XML of the XSD. To do that, right-click on the .xsd in the Solution Explorer, choose "Open With" and choose the "XML Editor" (you can even set it to the Default if you want to).



  • akaRickShaw

    I agree that a DataSet should not know anything about where the data is coming from. I don't know what they were thinking when they tied the two together. Although you'd think if they were pushing that concept they would have made sure it worked...

    In anycase, the folks at MS should know that the IDE doesn't work.


  • Cannot add table adapter to datatable