Here are the steps I took to get it to work correctly, hope it helps you.
1.) Created & Configured the "aspnetdb" database on the SQL Server:
a.) Confirmed SQL server was running, from the command line "sqlcmd -S./SQLEXPRESS" and get the "1>" prompt, type "exit" to exit sqlcmd prompt.
or use Services MMC, the Service may be named something like 'SQL Server(InstanceName)', or "SQl Server (SQLEXPRESS)"
b.) Ran the command line utility aspnet_regsql, which initiated the GUI Wizard, accepted all defaults for the database creation.
Confirmed the database "aspnetdb" was created.
c.) Used the SQL Server Configuration Manger to set the Network & Client Protocal settings
Disabled "Share Memeory" Protocal, another web site tip had indicated the the "Share Memory" protocal was problematic. In case you
Client Protocals "TCP/IP" & "Named Pipes" set to enabled
Moved Client Protocals order to 1 for "TCP/IP"
d.) Added and gave full acces to "NETWORK SERVICE" & "ASPNET" SQL logins to the "aspnetdb" database that was created by the aspent_regsql utility
e.) Enabled/Started the SQL Browser service.
Restarted SQL Server service.
2.)
Edited the Web.config file
Web.config snippet
----------------------------
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=MySQLServerName\MySQLSvrInstanceName;Integr ated Security=True;Database=aspnetdb;"
providerName="System.Data.SqlClient" />
----------------------------
Specifically
connectionString="data source=MySQLServerName\MySQLSvrInstanceName;Integr ated Security=True;Database=aspnetdb;"
If you do not have multiple SQL instance installed on you machine, then "MySQLServerName\MySQLSvrInstanceName" would not apply
could be server possibilities like "./SQLEXPRESS", "(local)", , "ServerName" or "."
3.) Used the Internet Information Services MMC
a.) Open the properties for the Web application and on the "ASP.NET" tab confirmed ASP.NET version set to 2.0
b.) Restarted IIS
b.) Restart IIS.
4.) Opened the website project with VS 2005, and selected "ASP.NET Configuration" from Website menu.
Confimed website connectivity to database by going to the "Provider Configuation" in the ASP.NET Web Site Administration Tool,
selecting "Select a single provider for all site management data" and then click the "Test" link and getting
the "Successfully established a connection to the database." confirmation.
|