winformsvisual-studio-2019sqldatasourceobjectdatasource

DataSource controls not available in .NET Windows Forms app using Visual Studio 2019


I am running Visual Studio Community 2019 version 16.11.3, and I am having a problem with the data source controls (both SqlDataSource and ObjectDataSource).

Neither control shows up in the Data tab of the toolbox, yet when I use the "Choose Items..." option they are both checked. I have gone so far as to uncheck them, save the changes and then came back in and re-checked them, but that didn't work either. Even if I use the "Show All" option they don't show. Can anyone shed some light on this?

I have tried the suggestions from other posts, including resetting the toolbox, adding a custom tab, and then resetting again, but nothing seems to work. I even switched to an older version of the framework (4.6) to see if this might be the issue, but nothing works.

Any suggestions?


Solution

  • According to Jim's comment, I compiled the answer.Just for helpling others to solve a similar issue.

    SqlDataSource and ObjectDataSource are used in ASP.Net, not Windows Forms.

    Generate a source of data using whatever means necessary, whenever needed.

    Use Visual Studio's Tools to handle a Project data source, through the Designer. -- Note that this object doesn't have any connection to a View, it doesn't need to handle states.

    To have a functionality similar to what you're probably used to, you also need a DataAdapter (working with DataTables) or a similar connector provided by an ORM. -- A BindingSource only handles notifications that are generated by the objects it's bound to and doesn't offer any data update feature.