-1

I'm using Visual Studio 2017

I have two projects in my solution. A C# Windows application and SQL project.

I have added two new tables to the SQL project and also added some fields to the existing tables.

When I open the app project the DataSet in the Data Sources window still only displays the original three tables and doesn't include the two new tables or the new fields to the original tables.

I have tried building/rebuilding the whole solution as well as the projects individually.

I have also tried going through the configure data source with wizard but the new tables I created are not there to select.

Matt
  • 14,906
  • 27
  • 99
  • 149
  • https://learn.microsoft.com/en-gb/visualstudio/data-tools/create-and-configure-datasets-in-visual-studio – user6144226 Jan 03 '18 at 22:28
  • Look at this QA https://stackoverflow.com/questions/9497689/update-dataset-structure-in-visual-studio-to-match-new-sql-database-structure – Steve Jan 03 '18 at 22:31
  • @user6144226 Tried that, when i go through the configure wizard no new tables are there to select – Matt Jan 03 '18 at 22:32
  • @Matt, at this point I'd check if the dataset connection for the designer is the same connection you edited your version of the DB and not something like a production config. Or try the regular restart/refresh cache invalidation cycle. – user6144226 Jan 03 '18 at 22:40
  • @user6144226 how can i check that? Pretty new to VS – Matt Jan 03 '18 at 22:41
  • @Matt, look around in the *Connection* part of the wizard - the important parts should be more or less "linked" somewhere in the previously mentioned part of the docs. – user6144226 Jan 03 '18 at 22:44
  • Choose your data connection only has one to pick from and thats my DB – Matt Jan 03 '18 at 22:46
  • @Matt, if it is the same server, same DB, and the user from the connection string has privileges to list these objects - I am offically out of ideas. If you have SSMS/SSDT installed - you should be to drag & drop tables from the *SQL Server Object Explorer* – user6144226 Jan 03 '18 at 23:11
  • @user6144226 everything was created inside of VS2017, all on my local machine, only 1 user (me) on laptop for windows auth – Matt Jan 03 '18 at 23:21
  • Did you deploy your database project? – Crowcoder Jan 03 '18 at 23:25
  • @Crowcoder I only have the deploy option on the solution, not on either of the projects inside the solution – Matt Jan 03 '18 at 23:47
  • Needed to publish it – Matt Jan 03 '18 at 23:58

1 Answers1

0

For anyone who was stuck like me,

You need to right click on the SQL project and click publish. enter image description here

Select the server your C#(or other) project looks at.

Once the publish is complete right click on your DataSet in the Data Sources window and then choose the Data Source Configuration Wizard. enter image description here

You can then add the new tables/fields into your DataSet . enter image description here

Matt
  • 14,906
  • 27
  • 99
  • 149