Friday, February 24, 2012

ASPNETDB.mdf - setting your website to use your hosted DB instead

Hi,

I'm running Visual Web Developer 2005 and have created a small site with a log-in function. In VWD this automatically creates the database ASPNETDB.mdf which stores all the user / log-on data.

I have 1 x MS SQL Server 2005 DB which I am using to store data for my site.

Can anyone advise me on how to setup my site / the ASPNetDB so that it runs on my MS SQL Server?

I've searched the ASP.NET forums etc and this does seem to be an area where people are struggling.

I have tried running the ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe) and get the following error:

"Setup failed.

Exception:
An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 8152 and the SqlException message is: String or binary data would be truncated."

As a beginner I've struggled from downloading an online template, then uploading it to my site, and the log-on doesn't work. There didn't seem any instructions / advice on what to do with the ASPNETDB.mdf database.

Help / advice would be much appreciated!

Thanks,

Tom

Hi gilbert,

This website is a great place to start reading about security and asp.nethttp://weblogs.asp.net/scottgu/archive/2006/02/24/ASP.NET-2.0-Membership_2C00_-Roles_2C00_-Forms-Authentication_2C00_-and-Security-Resources-.aspx

The things you are probably looking for are Windows or Forms Authentication with SQL Server 2000 (or 2005). When you use the log-in control and don't change any of the settings, for example in web.config, all the default settings will be used. Maybe that's what's causing the error.

This is a link on the page mentioned above, it's about forms auth. and it tells you how to set up that aspnetdb. (http://msdn2.microsoft.com/en-us/library/ms998317.aspx)

Hope this helps!
Wim

|||

theres 8 parts to it.

but the first couple talk about what your asking. in the articles tehre are also links to different other pages which can help you configure your site to use the MSSQL database you have.

http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

No comments:

Post a Comment