0

So I have a database running in SQL Server Management Studio.

The server information in the top of the Object Explorer says this:

(local)(SQL Server 10.0.2531 - Scott-PC\Scott)

How do I connect my ASP.NET MVC2 App to this instance. I want a connection string in the web.config and then I want to be able to have a Database.cs class that performs all the stored proc and queries.

2 Answers 2

1
Data Source=Scott-PC;Initial Catalog=DatabseName;User Id=Scott;Password=password;

check here for other options

Sign up to request clarification or add additional context in comments.

Comments

0

Here is a sample...

<connectionStrings>
 <add name="ProductionServerEntities"
      connectionString="metadata=res://*/Models.MyDBEntityModel.csdl|res://*/Models.MyDBEntityModel.ssdl|res://*/Models.MyDBEntityModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=MYSQLSERVER;attachdbfilename=C:\inetpub\domains\MyDomainName\App_Data\MyDB03.mdf;Database=MyDB06;integrated security=False;User ID=sa;Password=MyPassword;multipleactiveresultsets=True;App=EntityFramework&quot;"
      providerName="System.Data.EntityClient" />
</connectionStrings>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.