I have just installed VWD and SQLExpress, but when I try to access the security section of ASP.Net Configuration I get the following Error after trying to connect to the AspNetSqlProvider:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
After a lot of searching I have run the aspnet_regsql command and can now see a database has been created on my SQL Express Database, but I still get the same error can anyone please help.
Note: I am running htis all on Windows Vista if this makes any difference.
Run the SQL Server Configuration Manager. Select SQL 2005 Services and make sure "SQL Server (SQLEXPRESS)" is running, If not right click on it and then select 'Start'
What is the name of your database? By default the web site administration tool expects to see a database named ASPNETDB.MDF in your App_Data folder. You can change this in your web.config file. First you need to ensure you have a connection string pointing
to your database, then you need to change the providers for Membership, RoleManager and Profile to use that connection string. As an example:
gavinjb
Member
1 Points
18 Posts
AspNetSqlProvider Issues
Nov 30, 2007 06:48 PM|LINK
Hi,
I have just installed VWD and SQLExpress, but when I try to access the security section of ASP.Net Configuration I get the following Error after trying to connect to the AspNetSqlProvider:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
After a lot of searching I have run the aspnet_regsql command and can now see a database has been created on my SQL Express Database, but I still get the same error can anyone please help.
Note: I am running htis all on Windows Vista if this makes any difference.
Thanks,
Gavin,
smcoxon
Contributor
5455 Points
948 Posts
Re: AspNetSqlProvider Issues
Nov 30, 2007 10:08 PM|LINK
Hi,
Run the SQL Server Configuration Manager. Select SQL 2005 Services and make sure "SQL Server (SQLEXPRESS)" is running, If not right click on it and then select 'Start'
Smcoxon
No Gem is ever polished without some friction.
gavinjb
Member
1 Points
18 Posts
Re: AspNetSqlProvider Issues
Dec 01, 2007 09:23 AM|LINK
Hi,
Yes SQL Server Express Services are running as I can login to SQL Server Management Studio Express and access the data in the various databases.
Thanks,
Gavin,
smcoxon
Contributor
5455 Points
948 Posts
Re: AspNetSqlProvider Issues
Dec 01, 2007 06:28 PM|LINK
What is the name of your database? By default the web site administration tool expects to see a database named ASPNETDB.MDF in your App_Data folder. You can change this in your web.config file. First you need to ensure you have a connection string pointing to your database, then you need to change the providers for Membership, RoleManager and Profile to use that connection string. As an example:
<connectionStrings> <add name="MyConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MYDATABASE.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>Smcoxon
No Gem is ever polished without some friction.
gavinjb
Member
1 Points
18 Posts
Re: AspNetSqlProvider Issues
Dec 04, 2007 11:58 AM|LINK
Thanks got it to work, in the end I had to add the following
Update: I also had to run the following commands from SQL:
Thanks,
Gavin,
smcoxon
Contributor
5455 Points
948 Posts
Re: AspNetSqlProvider Issues
Dec 04, 2007 09:26 PM|LINK
Great, glad you've got it working. Please mark as answered if I was of assistance.
Regards
Sean.
Smcoxon
No Gem is ever polished without some friction.
gavinjb
Member
1 Points
18 Posts
Re: AspNetSqlProvider Issues
Dec 06, 2007 08:44 AM|LINK