Showing posts with label aspnetdbmdf. Show all posts
Showing posts with label aspnetdbmdf. Show all posts

Saturday, February 25, 2012

ASPNETDB.MDF?

Using VS2005, VB backend and javascript,

I have developed a relatively simple site - its got a few (12) simple aspx pages but its mostly client side javascript. Keeping disk storage costs down is a big concern with this my site. The disk usage for the site is ~24M. Since this was larger than I expected I started inspecting the files comprising my site and found that the "ASPNETDB.MDF" in my "App_data" folder is consuming 10.2M by itself. The thing is that site only has a few pages with calls to SQL Server - but I never did anything (that I know of) with ASPNETDB.MDF. Through VS2005, I opened up the MDF file and poked around, everything that I looked at was empty (NULL).

So my questions are:

What is causing the ASPNETDB.MDF to consume 10.2M even thought I can't see any data stored in it?Is there anyway for my to reduce the size of this file? If so, how?

Your input appreciated.

Should I be posting this in a different forum?|||

Hi,

The ASPNETDB contains a lot of information about table structure and membership information about your site.

To check what is occupying the storage, you can run DBCC CHECKDB on your local machine to see the allocation, structural, and logical integrity of all the objects in the specified database.

For more information, please check the following link.

http://msdn2.microsoft.com/en-us/library/aa258278(SQL.80).aspx

HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!

ASPNETDB.MDF: The process cannot access the file because it is being used by another proce

Hi,

I'm trying to upload the ASPNETDB.MDF file to a hosting server via FTP, and everytime when it was uploaded half way(40% or 50%)

I would get an error message saying:

"550 ASPNETDB.MDF: The process cannot access the file because it is being used by another process"

and then the upload failed.

I'm using SQL Express. Does anybody know what's the cause?

Thanks a lot

It is because there are some users who are accessing the database through your web application. When the database is in process you cannot replace it. If you want to upload you need to make sure that no one is accessing your application. ASP.NET provides an easy way to disconnect all the clients to your web application with app_offline.htm file

Just create a simple html file with name app_offline. First upload this file to the web root of your application. Once this file was placed into the root directory, all clients will be disconnected and you can make some quick changes like replacing files etc, and after you finish replacing the files, delete the app_offline.htm file from the root.

You can also display a friend message in the app_offline like "Site under maintenance"

app_offline.htm file:

<html>
<body>
Site under maintenance!
</body>
</html>

Thanks

ASPNETDB.MDF, My Own Database and Deployment

This question has been asked before, with vague responses

I'm using Visual Web Developer 2005 Express, SQL Server 2005 Express and SQL Server Management Studio Express.

When I create an application with Login controls, VWD automaticlly creates a ASPENTDB.MDF security database. I also create my own database for my application e.g. abc.mdf. In other words, I have two databases. However, my hosting company supports only one database. What do I (we) do?

I have seen articles on:aspnet_regsql . Does this create a new database with all the security features of ASPNETDB.MDF built into my new database i.e. abc.mdf?

(A) If yes, how do you run it with SQL Server Managment Studio Express? It sounds silly, but I need instructions here please ... Also, do you run this against abc.mdf or do you use it create abc.mdf?

(B) If not, how do you achieve a single database scenario?

I'm sure this is a very common deployment question, which is very confusing for most of us hobbyists that want to deploy their web applications

As I understand, by default the data for a application will be stored in the database (ASPENTDB.MDF ) automaticlly created by VWD--you can change your connection string to connect other databases and the data will be only put into 1 database. To understand how your website using the database, you can take a look at :

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

If you want to maneger the database in Management Studio, you can detach the database from your application (right click it in Server Explorer), then attach it in Management Studio. You can refer to this article:

http://msdn2.microsoft.com/en-us/library/ms187858.aspx

|||

Thank you for the response. I have seen the first URL previously and have some questions on running theaspnet_regsql.exe utility

1. I do NOT have the full blown SQL Server 2005 version on my development machine (nor do I have it in my LAN). Do I need to have this in order for the aspnet_regsql utility to work?

2. I still want to develop and test locally and when satsified upload to the web hoster. If aspnet_regsql creates a full SQL Server 2005 database version for me locally, how do I manage it using VWD locally, because VWD works with the SQL Server 2005 Express version?

3. By running aspnet-regsql, does it fundamentally change VWD from using SQL Server 2005 Express thereafter for other new sites, projects and solutions on the same development machine? I do not want this to be the case

4. Can I undo or reverse the effects of running aspnet_regsql?

Cheers

ASPNETDB.mdf Resolved

Hi,

I thought I had this corrected, but in fact don't. According to http://msdn2.microsoft.com/en-us/library/ms228037.aspx

SQL Express is supposed to automatically generate a copy of ASPNETDB.mdf in the App_Data folder of the Express edition development suites (I'm using Visual Web Developer 2005).

In my case, it doesn't, and I can't figure out how to trigger it manually. I've read every post I can find, especially http://forums.microsoft.com/msdn/showpost.aspx?postid=98346&siteid=1

However, that mainly applies to deploying a database that already exists. I have already tried deleting the files as suggested and they do reappear in the appropriate folder, but I'm still not getting the ASPNETDB.mdf file in my apps.

Any help on this would be greatly appreciated. I've had a post up on the Visual Web Developer forum, but folk are staying away in droves. Also tried uninstall and reinstall all the way down to IIS 5.1

biobot

You install the database by executing Aspnet_regsql.exe
in your %windir%\Microsoft.NET\Framework\<Your.Net Framework version> folder

You can find installation instructions and other information in the following article:

How To: Use Role Manager in ASP.Net 2.0

http://msdn2.microsoft.com/en-us/library/ms998314.aspx

-Sue

|||

Sue,

Thank you! It took some improvising, but I am now getting the aspnetdb.mdf auto-generating as is should. (There are some differences between the SQLEXPRESS Management Suite and Enterprise Manager, apparently).

I never would have thought to look up how to use Role manager to solve this problem!!?

Also, it is great to get a response in complete, contextually relevant sentences!

Best regards,

Larry

|||Open Visual Web Developer Express (VWD). Open the website in VWD. Click on the 'Website' menu. At the bottom of the website menu is ASP.Net configuration, open it. It opens ‘Asp.Net Website Administration Tool’. Under the 'Security' tab add a user.

Done; ASPNETDB.mdf is up and configured for your website|||Doesn't work in a shared environment

aspnetdb.mdf on Hosting Server ?

I have established roles to restrict access to the dataentry pages. The database is SQL Server which I've established on the hosting server. Security was previously maintained through~/app_data/aspnetdb.mdb (MS Access). It works, but isn't too stable, so I have modified the security to useSQL Server with an aspnetdb.mdf file, also located in the app_datafolder. Is this appropriate? Since it doesn't work, I assume not.

It's now my assumption that I need to setup a SQL Serverdatabase to support the security/roles. I have seen some reference tousing a script to build the aspnet.mdf on the hosting server. IfI do create such a database, is there anything special I need to do tohave my application read the aspnetdb? Do I need a connection stringin the membership and/or roleManager sections of my web.config.

A little guidance would be appreciated.

Thanks

http://www.eggheadcafe.com/articles/20060529.asp

|||

Thank you Dr. Bromberg for the extensive material you've pointed me to. I have downloaded the code and created a web site on my local Visual Studio server. I was able to run the SQL to create the two databases, Articles and aspnetdb (I think that's what I was suppose to do?). I have modifed the web.config to reflect the localhost information. When I run the Default.aspx I receive the following error:

Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.

OK, something's not setup properly. I attempted to run the SetupASPNetDatabase.aspx page and get absolutely nowhere, most likely because I have no idea what values to submit in the query boxes.

Bottom line is, I am not clear on what I need to do to get started. I am sure there is considerable information to glean from your article and sample web site. I would genuinely like to learn from it. The problem I seem to be having through is getting the security configured, which takes me back to square one with my initial question. I feel as if I am in the proverbial Catch 22. I need to get my own hosted security working and/or get your sample working before I can get either of them working.Crying

|||

To try and answer your question about setting up security with SQL Server...

1. Install the security schema (tables, procedures etc) on the SQL Server database. You can do this on your local machine by running aspnetregsql.exe (it's an installation wizard which comes with the ASP.Net framwork). If you have full control on your hosted server, then install the same way, otherwise your hosting provider will have to assist (some offer the installation as an option via their Control Panel). Note that the database doesn't have to be called ASPNETDB, you can install the security schema into an existing database of a different name.

2. Set up a connection string that points explicitly at the SQL Server database i.e. server name, database name, user id and password.

3. Point the Membership provider at this connection string.

I've put a specific example from one of my own web.config files using SQL Server - this is the connection string from mydevelopment environment (so uses localhost for the server name). Can you see that the Membership provider points at the "MainDB" connection string - which is pointing at the SQL Server?

The live web.config settings are very similar, except that instead of localhost I have the name of the server. Hope this helps!

<connectionStrings>

<addname="MainDB"connectionString="Server=localhost;Database=DB_138621;User ID=*****;Password=*****"providerName="System.Data.SqlClient" />

</connectionStrings>

--- snip -----

<membershipdefaultProvider="AspNetSqlMembershipProvider">

<providers>

<clear/>

<addname="AspNetSqlMembershipProvider"type="System.Web.Security.SqlMembershipProvider"connectionStringName="MainDB"minRequiredPasswordLength="5"minRequiredNonalphanumericCharacters="0"requiresQuestionAndAnswer="false"enablePasswordRetrieval="true"enablePasswordReset="false" applicationName="/"/>

</providers>

|||

Thank you Salmon. Using your example and wading through my web.config with fat fingers, I was finally able to make this work.Yes

Friday, February 24, 2012

ASPNETDB.MDF is read-only....

Hello everyone.

I am to create a sample site using the club site example. I had a problem with the IIS but now it is solved.

Now i copyied the site to the IIS and it is running. But i cannot access ASPNETDB.MDF. It keep saying that the database is read only... It is not read only!!!

Can any one help me??

System.Data.SqlClient.SqlException: Failed to update database "C:\INETPUB\WWWROOT\NEO\APP_DATA\ASPNETDB.MDF" because the database is read-only.

Thank you in advance.

Iasonas

Try granting the NETWORK SERVICE account R/W access to the contents of your app_data folder (mdf's and ldf's)and the folder itself.

If that doesn't work, please take a look at this post:

http://forums.asp.net/thread/906040.aspx

Why not using search feature in this formus:) Maybe you issue is a common one, then you can find some possible solution by searching the formus rather than just waiting:)

ASPNETDB.MDF is readonly

I have downloaded and installed ASP.NET Ajax Sample applications from

http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

I am trying to run the AJAX TaskList example under C:\Program\Microsoft ASP.NET\ASP.NET AJAX Sample Applications\v1.0.61025\TaskList

First I moved the content of the TaskList folder to a virtual IIS directory, making it possible to debug the website on my local IIS server.

When I run the example I get prompted to Login or register as a new user. When I submit the registration form I receive the following error message:

Failed to update database "C:\INETPUB\WWWROOT\TASKLIST\APP_DATA\ASPNETDB.MDF" because the database is read-only.

How can I modify the permissions forASPNETDB.MDF in order to run the TaskList example.

Thanks

Additional information:

I have installed SQL Server Management Studio Express as I figured this tool might help me to change the permissions. It did not help. I also tried to delete ASPNETDB.mdf, and recreate it by going Website -> Asp.net configuration by adding a new user. I still receive the same error message.

When I point the connection string to a remote SQL database of mine it is possible to register users in ASPNETDB.mdf. But I havn't figured out how to add users using a local version of ASPNETDB.mdf.

I am running Visual Studio on Windows XP. In windows XP you can't just modify permissions for folders as far as I know. I have recently installed SQL Server Management Studio Express as I said before.

I read somewhere that the read/write property for ASPNETDB.mdf may be enabled by checking a box somewhere.

But in SQL Server Management Studio Express tried the following:

*Right click on databases and click attach

*Click Add and select the database ASPNETDB.mdf

*Click OK

*Right Click on the path for ASPNETDB.mdf and click properties

When I click 'Options' under select a page Database Read-Only is already set to false.

If there is not way to use a local version of ASPNETDB.mdf (App_Data folder) I simply have to put up with my remote MS SQL 2005 database. But the subscription fee for this database is outrageous, and therefore I hope that someone might help me and everyone else by providing the appropriate steps to use ASPNETDB.mdf located to the App_Data folder, both on the local IIS server and server side.

Thanks
Svenbro

|||This can be a permission ?issue. Open Management Studio Express->connect to SQL Express instance->go to Security->Logins->make?sure the 'NT AUTHORITY\NETWORK SERVICE' account is there.|||

The 'NT AUTHORITY\NETWORK SERVICE' account is not in the list, but there is a similar item: NT INSTANS\SYSTEM

Should I add 'NT AUTHORITY\NETWORK SERVICE' as a new account with the Windows authentication property checked?

Thanks,

|||NETWORK SERVICE?is?hidden, just type it and click check name in the browse text, you should get it.

ASPNETDB.MDF in Visual Studio 2005 > ISP-hosted MS SQL

I am using (and making some enhancements to) the auto-generated ASPNETDB database in Visual Studio 2005. Now, I would like to deploy the application I have built (together with the data it contains and uses) to my ISP's ASP.NET 2.0 server and my freshly-purchased MS SQL database.

I haven't a clue how to do the above. Some other posts mention Entreprise Manager and Data Transformation Tools, but I really don't know where to start. I wonder if someone would be kind enough to go through each step in detail? Don't worry about sounding condescending... I really am a novice!

I apologise for the naivety of this message...!

Any and all help hugely appreciated!

Josh Ord-Hume

ANy response to your problem with ASPNETDB. I've got a similar problem and at this time it appears that you can't use the login controls in a remote-hosted environment. I'm starting to wish I had used ColdFusion.

Thanks,

Will

|||

In general, you can deploy the database by simply copying the mdf and ldf files. Shut down SQL Server and copy out the files.

Then the ISP can "attach" these to a new instance of SQL Server. This works as long as both versions of SQL Server are the same version.

Another common alternative is to backup the SQL Server database and then give the backup to the ISP and they can restore it to a new database on the SQL Server. To backup the database you can use Enterprise Manager GUI to do this, read the help topics on backup. You can use the BACKUP TSQL command to automate this as well (single TSQL command will create a backup of your database to a file). If you want to automate this and you do not care to understand the TSQL, you can turn on SQL Server Profiler, then backup the database using the GUI, then in SQL Profiler the TSQL command to backup the database will be logged and you can copy and paste this to backup the database again later using TSQL.

Most ISPs who host SQL Server will know how to restore a database from backup.

The only other issue you will have is setting up the proper connection string in your ASP.NET code. Ensure you use a configuration file for the connection string and this way the ISP can easily point the connection string to the proper SQL Server database.

ASPNETDB.MDF in Visual Studio 2005 > ISP-hosted MS SQL

I am using (and making some enhancements to) the auto-generated ASPNETDB database in Visual Studio 2005. Now, I would like to deploy the application I have built (together with the data it contains and uses) to my ISP's ASP.NET 2.0 server and my freshly-purchased MS SQL database.

I haven't a clue how to do the above. Some other posts mention Entreprise Manager and Data Transformation Tools, but I really don't know where to start. I wonder if someone would be kind enough to go through each step in detail? Don't worry about sounding condescending... I really am a novice!

I apologise for the naivety of this message...!

Any and all help hugely appreciated!

Josh Ord-Hume

ANy response to your problem with ASPNETDB. I've got a similar problem and at this time it appears that you can't use the login controls in a remote-hosted environment. I'm starting to wish I had used ColdFusion.

Thanks,

Will

|||

In general, you can deploy the database by simply copying the mdf and ldf files. Shut down SQL Server and copy out the files.

Then the ISP can "attach" these to a new instance of SQL Server. This works as long as both versions of SQL Server are the same version.

Another common alternative is to backup the SQL Server database and then give the backup to the ISP and they can restore it to a new database on the SQL Server. To backup the database you can use Enterprise Manager GUI to do this, read the help topics on backup. You can use the BACKUP TSQL command to automate this as well (single TSQL command will create a backup of your database to a file). If you want to automate this and you do not care to understand the TSQL, you can turn on SQL Server Profiler, then backup the database using the GUI, then in SQL Profiler the TSQL command to backup the database will be logged and you can copy and paste this to backup the database again later using TSQL.

Most ISPs who host SQL Server will know how to restore a database from backup.

The only other issue you will have is setting up the proper connection string in your ASP.NET code. Ensure you use a configuration file for the connection string and this way the ISP can easily point the connection string to the proper SQL Server database.

ASPNETDB.MDF I need to rename this file

I need to rename this db and be able to set a path to it. This is because my webhost places all SQL databases on a seperate drive. This is a shared drive with alot of other databases. There fore my ASPNETDB.MDF needs to be renamed and have a path assigned. This doesnt seem tro be taken care of in my web.config file? Can some one help in reasigning the default database name and pathway. my other databases were pretty straight forward.

Thanks

Use this setting in web.config:

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.mdf;Database=ms;Trusted_Connection=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings
Replace the AttachDbFilename setting with your own.

Jos

|||

I don't believe the autoattach feature with the User Instance attribute is going to work in a hosted web site, as this only works with SQLEXPRESS and only for the local machine. Most likely your hoster is NOT running SQL Express. You can use the Database Publishing Wizard to script the entire database, connect to the one for your account at the hoster, and run your script to recreate your "stuff".

|||

Both these answers are good. I dont seem to have a database publishing wizard in my express editions. I do need to get access to this though as am using scripts atm.

I have created a passwords login page and roles. when i set these in the web administration tool it created a db called ASPNETDB.MDF.

in the public database drive at my webhost there are lots of db's and I have to give my db a unique name. When I try and change the name of this db on my development system express creates a new db with the name ASPNETDB.mdf.

(due to a video i just saw) I think I can solve this issue by running aspnet_regsql but i cant get this program to access ssmse as my development copy of ssmse does not allow remote access.

|||

There are System.Web.Management (I believe that's the namespace) classes that allow you to create code (or a page) that does everything that ASPNET_REGSQL.EXE does.

The Database Publishing Wizard is a free download. Look it up on the web. Cheers.

|||

Thanks to you both you have been a great help.

Aspnetdb.mdf and aspnetdb_log script files

Hi,

Please any one can pass me Aspnetdb.mdf and aspnetdb_log scripts files in order to create those databases in sql server 2000.

thanks.....

Assumung that this is related to the Visual Web Development Kit, this can be downloaded under:
http://msdn.microsoft.com/vstudio/express/vwd/
HTH, jens Suessmeyer.

|||

Assuming that you mean the database that is created from the Visual Web Develoepr Package you can download it here. Once downloaded there should be a package to install the database within the web admin package.
http://msdn.microsoft.com/express/vwd/

HTH, Jens Suessmeyer.

ASPNETDB.MDF ... whyyyy? :(

Hello!
I have my own database file, but when I run my site in debug mode it creates aspnetdb.mdf again and stores all users in there ... question is - why? :((

I've attached my own db to sql server express, ran "aspnet_regsql.exe -W" on it, so it got all the schema in there.

Here's what I have in my web.config
----
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=ME\SQLEXPRESS;Initial Catalog=myOwnDB;Persist Security Info=True;User ID=user;PWD=password" providerName="System.Data.SqlClient"/>
</connectionStrings
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<remove name="AspNetSqlProvider" />
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
requiresUniqueEmail="true"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
applicationName="/" />
</providers>
</membership>
----

so i connect straight to sql server, not local file (so i dont have to attach / detach the db all the time)

but when i create new user through ASP Config, it creates them in aspnetdb.mdb file :(
can anyone explain me what im doing wrong here?

thanks in advance!

As I know the aspnet_regsql.exe utility is used to create schema for hosting asp.net data in a specific database, and it doesn't mean all your web applications will push the data into the database specified by aspnet_regsql.exe. This article shows how to customize the database for storing aspnet data:

http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx

ASPNETDB.MDF & SQL Server

When I first sign up with Visual Web Developer, Do I continue to use this database ASPNETDB.MDF or do I need to connect to the Microsoft SQL Server Database? Does Visual Web Developer Express automaticaliyy connect to SQL Server Express Edition?

Thanks

Computergirl

SQL Express only allows a single connection, and no hosting company are using this version. It depend on what your purpose, if it's only for self learning, then it's OK.

Visual Web Developer Express does not automatically connect to SQL Express.

More info on how to setup the connection string:http://msdn2.microsoft.com/en-us/library/ms247257(VS.80).aspx

ASPNETDB.mdf "...already in use..." Error and Broader Questions

When you create and host an ASP.Net 2.0 site on your local computer and then configure .Net 2.0's drop-in user registration and management system it creates a SQL file named ASPNETDB.mdf with a whole bunch of tables and stored procedures (…as most of you know). If you add your own custom tables to that database file and then try to call those tables you get an error that says that ASPNETDB.mdf is already in use. One way to get around this is to create a separate database in the form of another ".mdf" file and then put all of your own custom tables in it. You avoid the "...already in use..." errors that way but all your user accounts and the primary key structure that identifies them are in the original ASPNETDB.mdf file. This makes it impossible to do primary/foreign key relationships between those tables and those in the new separate database you created. It's kind of a catch-22 situation...unless I'm missing something that relates to releasing the ASPNETDB.mdf file from use whenever it is called so that additional tables and queries against that database file can be made without the "…already in use…" error cropping up. I am wondering if this problem is because the ASPNETDB.mdf file is not a "real" SQL database and as such imposes multiple-connectivity limitations such as those I am seeing. If this is true, migrating to a real SQL database would alleviate this? Finally, from a broader security and scalability standpoint…what are the best practices relating to use of the ASPNETDB.mdf database for all your custom tables? Should an additional database be created for all my application's custom tables (leading to the primary/foreign key problems) or should the additional tables be put into the ASPNETDB.mdf file (with some way of working around the "…already in use…" error)? A long-winded and broad question…thanks in advance for any responses.

MDCragg

The default membership provider already has an open connection to the file, which seems like the reason why you can't make your own connection. Perhaps you could extend this provider to keep its current functionality, but add your own requirements to access the other tables, as well. The default provider is the System.Web.Security.SqlMembershipProvider class. After you create this, set it as the default provider in your web.config.

Sample on how to configure a membership provider in web.config:http://msdn2.microsoft.com/en-us/library/44w5aswa.aspx

|||

That article tells how to merge the membership provider tables and stored procedures into my own database. I will try this to see if it solves the problem. I am at least a little bit doubtful if it will though because it seems like it will just shift the same persistent and exclusive connectivity problem I am having from the current user account database to my own database.

|||

This seems to have worked. I installed SQL Server Management Studio Express. I wasn't able to navigate to the existing custom database that I had created so I copied it to the default directory that SQL Server MSE utilizes. I was able to connect to it there and thus "attach" it to my PC's SQL host. Once that was done I was able to use the aspnet_regsql.exe utility to populate that database with all of .Net's Membership tables, views, stored procedures, etc. I copied the database back to the App_Data folder. I adjusted all the Membership entries in the web.config folder to "point to" the custom database instead of the ASPNETDB.mdf file (which I removed). I did some additional tweaking with things such as connection strings. Then I launched the site and everything seemed to work. I am able to connect to the .Net Membership tables as well as all my own tables...all of which exist in the one custom database file.

So, this is fixed although I don't know what the difference was between the ASPNETDB.mdf file and the custom ".mdf" file that I created. I'm sure there is a setting or two somewhere in the database instance, the connection, or something or other that led to the difficulty.

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

ASPNETDB.MDF - need to use SQL Server 2000

Hi,

I'm building an intranet app for a client using ASP.NET 2. The client is running SQL Server 2000 - and does not have plans to upgrade to 2005 anytime soon.

Is there a script that I can use to create the objects in the ASPNETDB database so that I can do this in SQL Server 2000?

Also, what additional changes would I have to make in order for the application to point to a SQL Server 2000 database with these objects?

Thanks in advance, Al

MDF(Microsoft data file) is only one half of a SQL Server database, the other half is the LDF(Log data file). That said the Personnal and Club starter kits comes with the membership database and Microsoft created a SQL Server 2000 version of both so I think you can install both take the membership related tables, triggers and stored procs. You know it is all manual so you just right click on the object in Object browser in Query Analyzer and click on create to generate the scripts. Hope this helps.

http://www.microsoft.com/downloads/details.aspx?FamilyId=0DD83A11-6980-4951-A192-DA6EACC6A19E&displaylang=en

http://www.microsoft.com/downloads/details.aspx?FamilyId=2EE85ED4-7613-47E2-8375-17222B150E4F&displaylang=en

|||Hi luckydog,

as alternative in clean way, you can run aspnet_regsql in command prompt and choose any database instance that you want to have membership tables inside it.

Run it in .Net Framework SDK Command Prompt

ASPNETDB.mdf

Hi,

I thought I had this corrected, but in fact don't. According to http://msdn2.microsoft.com/en-us/library/ms228037.aspx

SQL Express is supposed to automatically generate a copy of ASPNETDB.mdf in the App_Data folder of the Express edition development suites (I'm using Visual Web Developer 2005).

In my case, it doesn't, and I can't figure out how to trigger it manually. I've read every post I can find, especially http://forums.microsoft.com/msdn/showpost.aspx?postid=98346&siteid=1

However, that mainly applies to deploying a database that already exists. I have already tried deleting the files as suggested and they do reappear in the appropriate folder, but I'm still not getting the ASPNETDB.mdf file in my apps.

Any help on this would be greatly appreciated. I've had a post up on the Visual Web Developer forum, but folk are staying away in droves. Also tried uninstall and reinstall all the way down to IIS 5.1

biobot

You install the database by executing Aspnet_regsql.exe
in your %windir%\Microsoft.NET\Framework\<Your.Net Framework version> folder

You can find installation instructions and other information in the following article:

How To: Use Role Manager in ASP.Net 2.0

http://msdn2.microsoft.com/en-us/library/ms998314.aspx

-Sue

|||

Sue,

Thank you! It took some improvising, but I am now getting the aspnetdb.mdf auto-generating as is should. (There are some differences between the SQLEXPRESS Management Suite and Enterprise Manager, apparently).

I never would have thought to look up how to use Role manager to solve this problem!!?

Also, it is great to get a response in complete, contextually relevant sentences!

Best regards,

Larry