0
votes

I created a view in the database in SQL Server Management Studio. The view is based on two tables, connected with an inner join. In Visual Studio I have an application with a typed dataset, I created a class view that contains fields the same as a view from database. What is troubling me is that I do not know how to fill the view object, because I want to create a list from it that I will display in the datagrid.

Do I need to create new table adapter or something else? I hope I explained well :)

1
Have you tried the automatic Dataset generation tool in Visual Studio? - shahsani
I do not even know that exists...:) I created dataset with Project/Add New DataSource...Where can I find that tool? - panzer
You add a Dataset by right clicking on your Project name in the Solution Explorer tool window. Then Add New Item, then from the dialogbox select Dataset - shahsani

1 Answers

1
votes

Use the steps given in the screenshot to add a new Dataset to your project:

Adding Dataset to project

After that follow the wizard to add your desired Tables/Views to the dataset - and create methods for how to get data into this dataset from DB.