Showing posts with label aspnetdb. Show all posts
Showing posts with label aspnetdb. Show all posts

Sunday, March 25, 2012

Attach an aspnet or sql2005 database on a sql2000 server

Hello

I want to attach an ASPNETDB database (generated by the asp.net login wizard system), which is a sql2005 .mdf database I think, to our SQL2000 server.

I tried to attach the file directly ; then to attach it to a sql2005 express server, "turning it" into a sql2000 database via the properties, then make a backup, then restore the backup on the 2000 server ; nothing worked out !
One of the method I tried (I don't remember which one) told me it could'nt read the sysindexes table ; of course, because there isn't such table on sql2005 databases.

So, is there a way to attach a SQL2005 database (so with no or few system tables) to a SQL2000 server (which requires those tables), or to re-generate the ASPNETDB in the SQL2000 format ?
If I re-create the syssomething tables on the SQL2005 database, will it work that simply ?

At the very last, I may have to install SQL express on the server. If there is already a SQL2000 server on the machine, will it cohabit with no problem ? Is the SQL express server ready for a production server with light or medium load ?

Thanks a lot, and sorry for so many questions ! :)

Hi,

"I want to attach an ASPNETDB database (generated by the asp.net login wizard system), which is a sql2005 .mdf database I think, to our SQL2000 server."

-That′s not working, the format is different to SQL Server 2k5, there is no backward compatibility.

""turning it" into a sql2000 database"

-Making the compatibility level to 2000 doesn't mean that the database is 2000 ready, it just behaves on a SQL2k5 machine like a SQL 2k database.

You will either have to script the object and the data out or bcp the data out or use any wizard to transfer the objects to the other SQL 2000 Server machine.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Ok, and if I export the database structure as a SQL script, will it just work ?

And for the SQL2005 Express server, is it usable along with the SQL2000 server, and does it fits for a ligt-load production server ?

thanks !
|||

Hi,

sure as long as you don′t use any new features of SQL Server 2005 and you take care of the difference of schema and owner you should be fine.

SQL 2k and SQL2k5X is working together. It can be also used as a light load production server (whatever that means in your case :-) ), it is only limited by the limitations of SQL Server Express, no query governor or anything else.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Saturday, February 25, 2012

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

Friday, February 24, 2012

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 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 with publish provider

Hi!

I have created a sql script with publish provider and the file has all information about ASPNETDB and now i want to drive the sql script into my databas on my webbhosting.

How do i? i haveSQL Server Management Studio Express to admin my databas.

any?

I doubt you can connect directly to the database server on your webhosting company, but if you can then you should do like this:

Start Management Studio Express. Choose connect to server. Enter the name of the server (or IP) you wish to connect to. Make sure you enter the correct username and password. In this case I believe you should be using SQL authentication with the login you've been given from your hosting company. Once logged in, you start a new query (which will basically give you an empty window). Make sure your database is selected in the combo, and then simply paste your SQL code and press "play" :-)

If you cannot connect directly, through Management Studio Express, they may have web interface (such asSQL Server Web Data Administrator)that you can use to login to the server through the browser. But you must check with the company if they have such a system.

If this option is not available either, then you need to wrap up your code in an ASP.net page and execute it on the server. Let me know if this is what you need, and I can help you getting started with this.

Good luck!

|||

I think it works fine, my tables was created in my databases system tables folder.

But when iam trying to login, i get this messages:

EXECUTE permission denied on object 'aspnet_CheckSchemaVersion', database 'dbname', owner 'dbo'.

DO you iknow anyting of that?

|||

You installed the tables under a database login that "owns" the database i.e. is dbo.

When you log into your application, the connection is using different login/password that is not dbo i.e. has not been permissioned to use the stored procedures within your database. Either use the dbo login to provider your application login with the appropriate permissions (in this case "GRANT EXECUTE on [stored procedure name] to [login name]", or assign your application login with dbo permissions.

If you take the former route of assigning permissions on the actual database objects to your application login - note that the login will probably need execute permissions on all the stored procedures starting with aspnet_ in that database.

|||

So now i have created my table with a correct owner, but when i try to login on my webpage, i get same error.

How can i change the login ASP.NET control to check this table owner.aspnet_Users instead of dbo.aspnet_Users?

Any?

|||

Why do you want the aspnet_ tables under a different owner? They really should be under dbo.

|||

Because i get error messages when i try to login on the webpage, (the error message i write on top).

But if you have another idés so tell me. My userid to the database maybee couldt work with owner dbo.

|||

One Simple Answer to You.

SQL Server Database Publishing Services

http://www.microsoft.com/downloads/details.aspx?FamilyId=6F03273C-FFC8-4F5E-BAFC-041FBD68FD1E&displaylang=en

ASPNETDB to another database

Hi there readers of this post,

Do you know how to transfer the database (ASPNETDB.mdf) tables made by the ASP.NET admin tool into another database?

I want to run everything from 1 database.

regards

Sat

Hi

What you can do is

Go to folder

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

in the above folder there is a file named "aspnet_regsql" run this file

it will ask you whether a default database or a partucular database in which you would like

to keep this. if you set it as default then it creates a new database"aspnetDB"

if you point to another databse[ say northwind] then all the tables necessary for member ship

do come in to northwind.

Try this if you still find issues let me know

With regards

Sridhar

ASPNETDB replaces my database in connection

Hi,
I've a little problem. When I connect my local server by this connection string:Data Source=NB126\SQLEXPRESS;Initial Catalog=TVRM;Integrated Security=TrueI get content of ASPNETDB.MDF (placed in App_Data directory) instead content of my own database named TVRM. Please help...

Hi ciTrus,

Are you sure your connection string is actually used when connecting to database?(a small trick here is that, assign a wrong server name which doesnot exist to your connection string and test again. see if your data still can be populated).

Rember that there is a default "AspNetSqlMembershipProvider" in you machine.config and if you are using sql express, this provider will direct your membership database to App_Data folder silently (which i think is the case you are currently in). If you want to use a custom membership database, you need to add a new membership provider and put it to your web.config.

like: <system.web>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<remove name="AspNetSqlProvider" />
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName=HERE IS YOUR CONNECTION STRING NAME
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
applicationName="/" />
</providers>
</membership>
</system.web>

Hope my suggestion helps

|||

Bo Chen,
thank you very much. I did exactly what you wrote and it worked.Big Smile

CiTrus

ASPNETDB relation with my databas

HI!
I have a ASPNETDB as my login databas. but now i want to connect this databas or the aspnet_user table to my table, how do i?
I want to check the username in aspnet_user table and select the same username in my table?

I want to write all sql code in a sql file. so i want to know how i can connect to the sql file from my c# code?

I hope somebody understand me...

Hi sallad88,

I want to write all sql code in a sql file. so i want to know how i can connect to the sql file from my c# code?

Not 100% sure what you mean by this, but if i understand you correct, you can write a stored procedure for this. Since what you want is to "check the username in aspnet_user table and select the same username in my table", you can write your stored procedure like this:

create procedure sp_check_name

as

select * from My_own_table
where Firstnamein

(select username from [asp.net db].dbo.aspnet_users ) // you can access asp.net db this way (specify the database name, schema name, table nameexplicitly)

And in your application, you can bind your sqlcommand to this stored procedure and call executereader function. This will return you desired result set.

Hope my suggestion helps

|||

Yes that was one thing...

And its work fine, I will come back when i can explain the other things better and when iam there in my application...

Thanks for know

aspnetdb on host, connection string

Hi

I am having trouble connecting to aspnetdb on the shared host. On my local server this is my connection string which works fine:

<addname="MyLocalSqlServer"connectionString="Data Source=.\SQLExpress;Integrated Security=SSPI;Initial Catalog=aspnetdb;User Instance=false"

providerName="System.Data.SqlClient" />

But, this doesn't work on the host (just putting in host address):

<addname="MyLocalSqlServer"connectionString="190.40...232,1444;Integrated Security=SSPI;Initial Catalog=aspnetdb_booksale;User Instance=false"

providerName="System.Data.SqlClient" />,

and I get the error :

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

so I put in the user id and password that i used when I created the aspnetdb_booksale db

<addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

providerName="System.Data.SqlClient" />

and I get the error:

The ConnectionString property has not been initialized.

Any ideas for me?

Amanda

Hi

My problem is not the connection string, because the one below works when I use the add user wizard. However, I get the error when I use the "createuser.membership" method. Funny tho it worked on my local server...

<addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

|||

So you mean you got the "The ConnectionString property has not been initialized" when you connect from remote machine using the connection string below?

addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

Really strange. Every time you got the same error message?

ASPNETDB migration

I created a website using Visual web developer express edition (including SQL Express). No the user management section of the site (the login/logout database) was created automatically and SQL Server express was installed at my computer under the instance name of SQLExpress. I uploaded it to my web host and he hooked up the ASPNETDB for me. Now the problem is that ASPNETDB has an id password and I was given theMSSQL Server IP. How do I configure my website to accommodate that? Any help will be extremely useful!!!

you need to modify the connection string in web.config

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="server=server ip;database=ASPNETDB;uid=youUsername;pwd=yourpassword"
providerName="System.Data.SqlClient"/>

</connectionStrings>

|||

WOW! Thats it! Thanks a bunch. One more thing. I am also using the same database to display some data(have added some tables into it manually). What should I put in the connection string to make the connection to the database? Also, can I use a MySQL database instead? If yes, what will be the connection string?

Thanks for your help.

|||

if you don't want to use the same name "LocalSqlServer", then you can add another connection with the same connectionString
like:

<add name="yourConnName" connectionString="server=server ip;database=ASPNETDB;uid=youUsername;pwd=yourpassword"
providerName="System.Data.SqlClient"/>

I am not sure if you can use MySQL as a configuration Database, but you can use it for application database.

Honestly, I didn't use it before. to get the exact connection string for MySQL, try to add a coonection from the wizard and see how vs2005 creates it in web.config

aspnetdb is on a "network path that is not supported for database files"

I have two, probably related, problems:

I have a very simple site. It will be used on the local intranet only. I want to use the windows authentication so users do not have to log on. The aspnetdb has been created using the configuration tool. If I use Server Explorer in vs to work on the site on my local machine, I can open aspnetdb, look at its tables, etc. If I use Server Explorer in vs to work on the site on the server, aspnetdb will not open and gives this error message:

..."network path that is not supported for database files"...

Other sites on the same server give the same message, but the sites work. I think this is because they can read the file but not write it; but that is a guess. We have tried everything; my head is ready to explode. We are using SQLServerExpress. It resides on the server's C drive (as does our data database). The web site, and hence the aspnetdb are on the F: drive of the same machine. Does SQLServerExpress treat the F: drive as a UNC drive? If so, are we in deep doo doo? I'm at a loss.

As far as logging in: If I debug from vs, the login works beautifully both on my local machine and running from the server using vs. Login does not work when accessing the site from iexplorer. Mystified by that one, too. I tried to implement profiles and they crash, too; that led me to consider a write problem.

Don't know what to do; any help is appreciated.

This is a common connection exception, which may be misleading in some cases. You may take a look at this article:

http://www.aspspider.net/resources/Resource170.aspx

aspnetdb connection string not found

Why I don't have connection string in web.config for aspnetdb.mdf database although the site works?Help plz?

You could have connection string in web.config,and reference it in your code,take gridview for example:

<asp:SqlDataSource ID="SqlDataSourcel" Runat="server"ProviderName="System.Data.SqlClient"ConnectionString="Server=(local)\SQLExpress;Integrated Security=True;Database=Northwind;Persist Security Info=True"SelectCommand="SELECT [ProductID], [ProductName], [UnitPrice] FROM[Products]"></asp:SqlDataSource>or "SqlDataSource1" runat="server" DataSourceMode="DataReader" ConnectionString="<%$ ConnectionStrings:MyNorthwind%>" SelectCommand="SELECT FirstName, LastName, Title FROM Employees">
In your soucecode you should find ConnectionString .|||The connection string for the database file created in your application is auto generated, you may take a look at this post:http://forums.asp.net/thread/1430985.aspx

aspnetdb connection string

Hello,
I'm getting up to speed with VS2005 and use SQL Server 2005. I'm using the login control in a test web app.

When I run the app I get this error:

Cannot open database "aspnetdb" requested by the login. The login failed.
Login failed for user 'UserID\ASPNET'.

The connection string I'm using is:

data source=localhost;Integrated Security=SSPI;Initial Catalog=aspnetdb;

The AspNetSqlProvider in the web administration tool connects to the database.

My question is, Is this a connection string issue, and user ID issue, a rights issue or is it something else?

Thanks,

Gaikhe

This is a permission issue on SQL, which indicates theUserID\ASPNETlogin dose not have sufficient permission to perform specific task(access in this case) on theaspnetdb database. You should add database mapping for this account to theaspnetdb database: open ManagementStudio->Explore the SQL instance->Security->Logins->view the properties of theUserID\ASPNETlogin->switch toUser Mapping tab-> add proper mapping and permission to the login.

ASPNETDB Connection Problems - Please Please Help!

Hi I am working on my final year project and after over coming one major problem with sql server I have encountered another.

It feels as if I have tried everthing to solve it but cant get my head around it. I really do not have much time left to finish my project and am very worried in case I cant get the app / db fixed in time.

The problem started when I was showing my friend the website over the internet. There was a space in the address / folder name so I decided to create a new folder and copy the contents of the code from the old folder to the new one. This included the app_data directory that holds the databases for my system.

After setting up a virtual directory in IIS v 5.1 i ran the website only to be confronted with not being able to log in.

I have three connections ..... aspnetdb.mdf, x.mdf, y.mdf.

x.mdf and y.mdf are both being read from ok when I run the app but it doesnt seem to be reading from the aspnetdb.mdf database.

I have tried all sorts of things and had all sorts of error messages including:

cant write to database as its read only

cant access database because its already there.

It seems to me that there is more than one aspnetdb.mdf file attached therefore the app is reading from the new one and not the one i want it to.

I will paste the web.config file below. Please note that before i copied and pasted code to a different location this web.config was working fine. Also note that when I hit ctrl+alt+del it shows up 3 sqlservr processes -

sqlServr.exe - Network Service
sqlServr.exe - Rodney (my log on name)
sqlServr.exe - ASPNET

<connectionStrings>

<add name="Classes" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Classes.mdf"

providerName="System.Data.SqlClient" />

<add name="Iftams" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Iftams.mdf"

providerName="System.Data.SqlClient" />

<remove name="UsersDB" />

<add name="UsersDB" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.mdf;Integrated Security=True;User Instance=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

I have tried reinstalling sqlserver, creating a new website from the vs2005 ide and also creating a virtual directory first and then copying files to it.

I have also tried attaching to management studio, changing user settings etc

I really dont know what to do next. My head is fried. Please help.

I would really appreciate your help on this one.

Regards in hope

Rodney

The ASP.net forum is a better place to ask questions about ASP.net and Visual Web Developer. You can find all the forums at http://forums.asp.net/ and the forum that is specifically about SQL Express in VWD at http://forums.asp.net/54/ShowForum.aspx.

Regards,

Mike Wachal
SQL Express team

-
Check out my tips for getting your answer faster and how to ask a good question: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=307712&SiteID=1

aspnetdb connection could not establish but database correctly created.

I installed netframework 2.0 Visual Web developer and MSSQL 2005 express edition with SQL Server management express.

I have got this configuration: 2*256 mb ram Intel Pentium 3.2Ghz Windows XP HUN SP2 latest version.

server name: localhost\SQLEXPRESS
Authentication: Windows Authentication

I run aspnet_regsql.exe and the setup wizard created aspnetdb see here, Microsoft sql server management studio can see the database:
MSSQL server management express & aspnetdb

But! When I run to the asp.net web application administration tool in Provider Configuration and choose
AspNetSqlProvider only 1
then I clickSelect a single provider for all site management data link -> then test

The Tool write this:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web SiteAdministration tool, use the aspnet_regsql command-line utility tocreate and configure the database, and then return to this tool to setthe provider.

Hi,

You application does not "know" where your database is. It is trying to find it in App_Data folder of your application. If it is not there you can specify its locaton by using connection string in web.config like this:

<connectionStrings>
<clear/>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>

|||

<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<clear/>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>

<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true"/>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

I paste But doesn't work.Sad modify the text or not? When I run the page createuserwizard

Kiszolgálóhiba t?rtént az alkalmazásban: ?/Website".Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.Leírás: Nem kezelt kivétel k?vetkezett be az aktuális webes kérelem végrehajtása során. A hibára és az azt okozó kódrészletre vonatkozó adatok az alábbi veremkivonatban találhatók.Hiba t?rtént az SQLExpress adatbázisfájl automatikus létrehozásakor:A kapcsolódási karakterlánc az alkalmazás App_Data k?nyvtárában található adatbázishelyet használó helyi SQL Server Express példányt ad meg. A szolgáltató megkísérelte automatikusan létrehozni az alkalmazás szolgáltatási adatbázisát, mert a szolgáltató megállapította, hogy az adatbázis nem létezik. A k?vetkez? konfigurálási k?vetelmények megléte szükséges ahhoz, hogy az alkalmazás szolgáltatási adatbázisának létezése sikeresen ellen?rizhet? legyen, és hogy az alkalmazás szolgáltatási adatbázisa automatikusan létrehozható legyen: 1. Ha még nem létezik az alkalmazás App_Data k?nyvtára, a webkiszolgálói fióknak olvasási és írási hozzáféréssel kell rendelkeznie az alkalmazás k?nyvtárához. Ez azért szükséges, mert a webkiszolgálói fiók automatikusan létre fogja hozni az App_Data k?nyvtárat, ha az még nem létezik. 2. Ha már létezik az alkalmazás App_Data k?nyvtára, a webkiszolgálói fióknak csak az alkalmazás App_Data k?nyvtárához van szüksége olvasási és írási hozzáférésre. Ez azért szükséges, mert a webkiszolgálói fiók megkísérli ellen?rizni, hogy az alkalmazás App_Data k?nyvtárában már létezik-e az SQL Server Express adatbázis. Ha visszavonja a webkiszolgálói fióktól az olvasási engedélyt az App_Data k?nyvtárhoz, a szolgáltató nem fogja tudni helyesen megállapítani, hogy már létezik-e az SQL Server Express adatbázis. Ez hibát okoz, amikor a szolgáltató megpróbálja még egyszer létrehozni a már létez? adatbázis másodpéldányát. Az írási hozzáférés azért szükséges, mert az új adatbázis létrehozásához a webkiszolgálói fiók hitelesít? adatait kell használni. 3. A számítógépen telepítve kell lennie az SQL Server Express programnak. 4. A webkiszolgálói fiók folyamatidentitásának helyi felhasználói profillal kell rendelkeznie. A mind a számítógéphez, mind a tartományi fiókokhoz készített helyi felhasználói profil létrehozásáról az információs fájl tartalmaz további tudnivalókat.Forráshiba:Az aktuális webes kérelem végrehajtása nem kezelt kivételt okozott. A kivétel okára és helyére vonatkozó adatok az alábbi veremkivonatban találhatók.Veremkivonat:[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735027 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +67[HttpException (0x80004005): Nem lehet csatlakozni az SQL Server adatbázishoz.] System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +122 System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +89 System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +26 System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +388Verzióinformáció: Microsoft .NET-keretrendszer verziója:2.0.50727.42; ASP.NET verziója:2.0.50727.42
|||

I don't understand I try to make an other database in app_data new_item anotherdatabase.mdf and I have got this message:
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
I reinstall Confused everything maybe next time work normal.

|||

Where is located aspnetdb.mdf?

|||

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\here

But I try to put them into the App_Data and doesn't work.
I install Windows Longhorn Beta (server 2008) and sites runingI try the same in my notebook windows XP HUN and workso I don't know what is the problem ,but NOW run everythingSmile and I don't care.

ASPNETDB - Unable to connect to SQL Server database

Hi Eevryone:

I seem to have corrupted my ASP.netWeb Site Administration Tool some how. It worked fine a few days ago, but reloaded SQL Server 2005 Express Edition W Adv Services SP1 yesterday I can not get past the "Unable to connect to SQL Server database" error. I have run the aspnetdb.exe and created both a aspnetdb.mdf and loaded the tables to into a existing mdf. I have checked all the permissions.

So any ideas on what I am doing wrong, or can you point me to some documentation on the 'AspNetSqlProvider'

Thanks in advance, Gene

You could erase the file in the appdata directory and it should recreate one fromscratch for you. actually, all you need is

<roleManager enabled="true" />

to get it to make the appdata express file

|||Exactly were do I am this entry?|||

Here is a very simple web.config with rolemanager enabled.

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="FetchEmailConnectionString" connectionString="Data Source=TM8200;Initial Catalog=FetchEmail;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<roleManager enabled="true"></roleManager>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

|||

Thanks again for the help.

Your sample web.config helped prove what I was beginning to suspect yesterday. It is the creation of user instances under .SQLExpress that is causing my problems. This makes sense considering that it was after I switched to .SQLExpress from SQL 2000 that my problems started. Any suggestions on where to find good user instance documenation? So far I have not found any good trouble shooting articles.

Cheers, Gene

ASPNETDB

In response to a problem I have, my web hosting company asked me to rename aspnetdb.mdf. When I ask why, I was given this response

...it is because SQLexpless is developed for single database. If there is a same db name in the server, it cannot attach to the server. In order to prevent conflict, so that you need to change the SQLexpress's dbname into others to prevent conflict with others db name...

Does this make sense?

I think there is some confusion here in terminology.

You should store data for your application database, with a name for you, you should not store your tables, views, sp etc in the aspnetdb database, I believe that Db is reserved for use by ASP.Net itself, hence there is only one per server. SQL Express can host ltos of DBs but only one of each name.