3

When setting up a new ASP.NET MVC Web Application, the default connection string inside Web.Config is something like this:

connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"

I'm just wanting to play around with logging in and registering, etc but when I run the app it obviously can't find a SQL database. What database with what tables do I need to setup to do this?

I have SQL Server 2005 Standard installed on my system, is that enough?

Thanks.

sorin
  • 161,544
  • 178
  • 535
  • 806
wows
  • 10,687
  • 7
  • 27
  • 27

1 Answers1

5

SQL Server 2005 is more than enough. The default connection string is looking for a SQL Server Express file in the App_Data folder. Replace it with the following:

Data Source=<server name>;Initial Catalog=<database name>;User Id=<user name>;Password=<password>;

If you want to generate the ASP.NET membership tables then run aspnet_regsql.exe, which is found in the .NET 2.0 framework folder (e.g. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727). A wizard will guide you through the process.

Misko
  • 2,044
  • 12
  • 15