471,107 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,107 software developers and data experts.

Do you have to rename ASPNETDB.MDF for ASP.NET 2.0 Web Hosters?

My web hoster says that I have to rename my ASPNETDB.MDF SqlExpress db for
my 2.0 site to work. Is this accurate?

If so, how can I rename it without breaking anything on my site?

FYI: This is the error I'm getting after I publish my site to their
servers...
An attempt to attach an auto-named database for file
c:\hosting\myhost\member\myaccount\customerdomains \mysite\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.
Jan 27 '06 #1
5 2957
Well,

If they already have a database out their with the same name (some other
customer probably deployed before you did and they are calling it first come
first served) your only choice will be to rename and change your code... You
should just need to change your connection string to the database file in
your web.config.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"VB Programmer" <do**@emailme.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
My web hoster says that I have to rename my ASPNETDB.MDF SqlExpress db for
my 2.0 site to work. Is this accurate?

If so, how can I rename it without breaking anything on my site?

FYI: This is the error I'm getting after I publish my site to their
servers...
An attempt to attach an auto-named database for file
c:\hosting\myhost\member\myaccount\customerdomains \mysite\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.

Jan 27 '06 #2
Thanks. Few questions...

1. Why should it matter since everything (like the connection string) is
referencing my app_data dir? Isn't the SQLExpress MDF handled similar to an
Access MDB database? It's just a database file in a dir...
2. If I simply rename the db (in VS2005) and change the web.config VS STILL
automatically creates the ASPNETDB.mdf. Any ideas why?

Thanks again....

"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:OM**************@TK2MSFTNGP10.phx.gbl...
Well,

If they already have a database out their with the same name (some other
customer probably deployed before you did and they are calling it first
come first served) your only choice will be to rename and change your
code... You should just need to change your connection string to the
database file in your web.config.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"VB Programmer" <do**@emailme.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
My web hoster says that I have to rename my ASPNETDB.MDF SqlExpress db
for my 2.0 site to work. Is this accurate?

If so, how can I rename it without breaking anything on my site?

FYI: This is the error I'm getting after I publish my site to their
servers...
An attempt to attach an auto-named database for file
c:\hosting\myhost\member\myaccount\customerdomains \mysite\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.


Jan 28 '06 #3
VB Programmer,

That's what I thought at first also. And I found out otherwise when I tried
to deploy a SQL Express database to a site experimentally. The ISP didn't
have SQL Express installed on the server. And because it wasn't installed my
database couldn't be loaded. It seems that SQL Express needs to be installed
on the server and it loads up databases just like SQL does. The only real
noticeable difference is how many connections it handles (of course there
are many other differences, but not many that affect day to day development
if a site is small). Anyway, no, SQL Express is not like an access database
file because the server has to be running a component.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"VB Programmer" <do**@emailme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Thanks. Few questions...

1. Why should it matter since everything (like the connection string) is
referencing my app_data dir? Isn't the SQLExpress MDF handled similar to
an Access MDB database? It's just a database file in a dir...
2. If I simply rename the db (in VS2005) and change the web.config VS
STILL automatically creates the ASPNETDB.mdf. Any ideas why?

Thanks again....

"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote
in message news:OM**************@TK2MSFTNGP10.phx.gbl...
Well,

If they already have a database out their with the same name (some other
customer probably deployed before you did and they are calling it first
come first served) your only choice will be to rename and change your
code... You should just need to change your connection string to the
database file in your web.config.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"VB Programmer" <do**@emailme.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
My web hoster says that I have to rename my ASPNETDB.MDF SqlExpress db
for my 2.0 site to work. Is this accurate?

If so, how can I rename it without breaking anything on my site?

FYI: This is the error I'm getting after I publish my site to their
servers...
An attempt to attach an auto-named database for file
c:\hosting\myhost\member\myaccount\customerdomains \mysite\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.



Jan 28 '06 #4
My hoster says they just started supporting SQLExpress (after much begging
by myself.)

The wierd thing is one data-driven page is working perfectly. All the
others (using the same db) give me the error:

An attempt to attach an auto-named database for file
c:\hosting\myhost\member\myaccount\customerdomains \mysite\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.

Any more insight is much appreciated.

Thanks again...

"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
VB Programmer,

That's what I thought at first also. And I found out otherwise when I
tried to deploy a SQL Express database to a site experimentally. The ISP
didn't have SQL Express installed on the server. And because it wasn't
installed my database couldn't be loaded. It seems that SQL Express needs
to be installed on the server and it loads up databases just like SQL
does. The only real noticeable difference is how many connections it
handles (of course there are many other differences, but not many that
affect day to day development if a site is small). Anyway, no, SQL Express
is not like an access database file because the server has to be running a
component.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"VB Programmer" <do**@emailme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Thanks. Few questions...

1. Why should it matter since everything (like the connection string) is
referencing my app_data dir? Isn't the SQLExpress MDF handled similar to
an Access MDB database? It's just a database file in a dir...
2. If I simply rename the db (in VS2005) and change the web.config VS
STILL automatically creates the ASPNETDB.mdf. Any ideas why?

Thanks again....

"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate.com> wrote
in message news:OM**************@TK2MSFTNGP10.phx.gbl...
Well,

If they already have a database out their with the same name (some other
customer probably deployed before you did and they are calling it first
come first served) your only choice will be to rename and change your
code... You should just need to change your connection string to the
database file in your web.config.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"VB Programmer" <do**@emailme.com> wrote in message
news:u%****************@TK2MSFTNGP15.phx.gbl...
My web hoster says that I have to rename my ASPNETDB.MDF SqlExpress db
for my 2.0 site to work. Is this accurate?

If so, how can I rename it without breaking anything on my site?

FYI: This is the error I'm getting after I publish my site to their
servers...
An attempt to attach an auto-named database for file
c:\hosting\myhost\member\myaccount\customerdomains \mysite\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.



Jan 28 '06 #5
VB Programmer wrote:
Thanks. Few questions...

1. Why should it matter since everything (like the connection string) is
referencing my app_data dir?
ASPNET looks for a specific connection string named "LocalSqlServer" to connect to the security database for its authorization, roles and membership info.
Isn't the SQLExpress MDF handled similar to an
Access MDB database? It's just a database file in a dir...
No, SQLExpress is a full-fledged relational database engine. Although the data is in an MDF file on the hard drive, that data file is manipulated every which way from Sunday by the engine.
2. If I simply rename the db (in VS2005) and change the web.config VS STILL
automatically creates the ASPNETDB.mdf. Any ideas why?


When you start the WebConfiguration tool in VS2005 (and there isn't a security database for the Web Site which is recognized as such by the VS2005 development server), a half-dozen SQL scripts are run to create the database and the tables within it. Those SQL scripts all have the database name of "ASPNETDB" hard-coded in them.

--
Take care,
Ken
(to reply directly, remove the cool car. <sigh>)
Jan 29 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by VB Programmer | last post: by
2 posts views Thread by te goody | last post: by
reply views Thread by mehdi | last post: by
4 posts views Thread by R.A.M. | last post: by
3 posts views Thread by =?Utf-8?B?RGF2ZQ==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.