LaserBeak
LaserBeak

Reputation: 3285

Few simple questions on managing different types of databases in Visual Studio SQL manager

Recently started with ASP.NET and MVC and have a few questions on working with databases.

Upvotes: 0

Views: 139

Answers (2)

Paweł Staniec
Paweł Staniec

Reputation: 3181

AD1. Sure you can connect to these DB's - just connect to .\SQLEXPRESS instance of you local MS SQL Express server using Windows Authentication. Optionally you can check if the database was created for you on the file system by going to :

C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA

AD2. To add Application Services structures (tables,stored procedures, views) you can use aspnet_regsql.exe GUI tool if you are using asp.net 4.0 it's in

c:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regsql.exe

This will recreate the structure for you. Othwerwise if you would like to keep using your .mdf database for Application Services puproses you only need to add connection string entry in your Web.config. Something like the below should work for you

<add name="ApplicationServices"
     connectionString="data source=|DataDirectory|aspnetdb.mdf;;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
     providerName="System.Data.SqlClient" />

Upvotes: 1

Adam Tuliper
Adam Tuliper

Reputation: 30152

  1. You should be able to point SQL management studio to .\sqlexpress and see your database
  2. To transfer data you can use the database Publishing wizard. Right click on your database in the server explorer view in visual studio and you should be able to publish to a provider which will generate your scripts etc for you.

Upvotes: 1

Related Questions