I'm really having hard time importing ASPNETDB.mdf to remote server running sqlserver 2005..
I'm using sql server express edition (along with visual web developer 2008)
I use the same string

<add name="aspnetusers" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"   providerName="System.Data.SqlClient" />

No connection can be established....

Then I changed that to

<add name="aspnetusers" 
connectionString="server=(local);AttachDBFilename=ASPNETDB.mdf;Integrated Security=True;"  providerName="System.Data.SqlClient"/>

I gives error
CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file ASPNETDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

I even copied(replicated) entire database to my remote server
but some stupid schematic version problem arises....

My control panel is PLESK

Please help me out how to fix this common problem....

I'm really having hard time importing ASPNETDB.mdf to remote server running sqlserver 2005..
I'm using sql server express edition (along with visual web developer 2008)
I use the same string
<add name="aspnetusers" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
No connection can be established....

Then I changed that to
<add name="aspnetusers"
connectionString="server=(local);AttachDBFilename=ASPNETDB.mdf;Integrated Security=True;" providerName="System.Data.SqlClient"/>
I gives error
CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file ASPNETDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

I even copied(replicated) entire database to my remote server
but some stupid schematic version problem arises....

My control panel is PLESK

Please help me out how to fix this common problem....

Hi,
After great search and hours of hit 'n trials ...I'm able to solve the problem...Just use C# to run .sql script generated after publishing the database using sql publishing wizard and run it using C# script..
If anyone want that...do ask me...

commented: thanks for offering +0

I'm really having hard time importing ASPNETDB.mdf to remote server running sqlserver 2005..
I'm using sql server express edition (along with visual web developer 2008)
I use the same string
<add name="aspnetusers" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
No connection can be established....

Then I changed that to
<add name="aspnetusers"
connectionString="server=(local);AttachDBFilename=ASPNETDB.mdf;Integrated Security=True;" providerName="System.Data.SqlClient"/>
I gives error
CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file ASPNETDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

I even copied(replicated) entire database to my remote server
but some stupid schematic version problem arises....

My control panel is PLESK

Please help me out how to fix this common problem....

do you have permissions on this remote machine to create a database. you will need an account which has the nescessary permissions to auto generate a db.

commented: nice pic +0

do you have permissions on this remote machine to create a database. you will need an account which has the nescessary permissions to auto generate a db.

Hello. Iam having the same problem

CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\Inetpub\vhosts\skect.net\httpdocs\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

What to do? Iam also using PLESK.

System.Data.SqlClient.SqlException: An attempt to attach an auto-named database for file C:\Documents and Settings\Sameer\Local Settings\Apps\2.0\Data\Z4YBX7D1.JK1\3WBWYJDK.EO3\sqlc..tion_6a5ad26de079ed06_0001.0000_a62e43de303e0b3a\Data\GCTMS_Data.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

PLEASE HELP FOR THIS ERROR.

Hi

This code is provide the connection of ASPNETDB.mdf.You can refer it.

<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer"
    connectionString= "Server=SQL_SERVER_ADDRESS,1433;Database= DATABASE_NAME;User=SQL_USERNAME;Password=SQL_PASSWORD;"
    providerName="System.Data.SqlClient" />
</connectionStrings>

If you want to more detail about ASPNETDB.mdf than refer this following link.

http://www.studiocoast.com.au/knowledgebase/6/aspnet/using-sql-server-instead-of-aspnetdbmdf.aspx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.