How to configure settings for visual studio?

describe it.

Last updated:1/7/2020 1:57:27 AM

1 Answers

Nishi Tiwari
Nishi Tiwari

Configuring settings

  • To open the sample app in Visual Studio, in the getting-started-dotnet\aspnet\2-structured-data directory, double-click 2-structured-data.sln.
  •  In the Solution Explorer pane, click Web.config.
  • In Web.config, complete the following steps:

a. Set GoogleCloudSamples:ProjectId to your project ID.

b. Set GoogleCloudSamples:BookStore to sqlserver.

c. Near the bottom of the file, under <connectionStrings>, find the connectionStrings XML sub-element with the attribute name='LocalSqlServer'. Update the connectionString value with the external IP address, database name, username, and password of your SQL Server instance. For example, the connectionString for a remote SQL Server on IP with database = bookshelf, user = dotnetapp and password = test looks like this:

connectionString='Data Source=;Initial Catalog=bookshelf;Integrated Security=False;User ID=dotnetapp;Password=test;MultipleActiveResultSets=True'

  •  Save and close Web.config.
  •  To build the solution, in the Visual Studio menu, click Build and then select Build Solution.
  • To create the database tables, in the Visual Studio menu, go to Tools > Nuget Package Manager > Package Manager Console. At the PM > prompt, enter the following command:

Add-Migration Init

  •  Create the tables in the SQL Server database that are used to store the books' data for the Bookshelf app. In the Package Manager Console, enter the following command: