URGENT & TRICKY: code for membership/profile fails when published to webserver

V

VB Programmer

I would appreciate your assistance on this ASP.NET 2.0 site....

This is the wierd problem: While accessing the built in .NET functions for
'profiling' or 'membership' an error is generated (see following 2
examples):

---- EXAMPLE 1 --------
OK --> Dim p As New ProfileCommon
OK --> p = Profile.GetProfile(Me.ddlRacer.SelectedItem.Text)
FAILS --> Me.lblDebug.Text = p.FirstName.ToString

---- EXAMPLE 2 --------
OK --> Dim u As MembershipUser
FAILS --> u =
System.Web.Security.Membership.GetUser(Me.ddlRacer.SelectedItem.Text)

These lines work perfectly locally. They fail after my site is published to
the webserver. I really feel this is a server related issue. Perhaps these
"libraries" are not installed correctly or something? Any ideas?

The error message is misleading and says this:

error received:
----------------------------------
server error in '/' application.
--------------------------------------------------------------------------------

an attempt to attach an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.
des_crip_tion: an unhandled exception occurred during the execution of the
current web request. please review the stack trace for more information
about the error and where it originated in the code.

exception details: system.data.sqlclient.sqlexception: an attempt to attach
an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.

source error:

an unhandled exception was generated during the execution of the current web
request. information regarding the origin and location of the exception can
be identified using the exception stack trace below.

stack trace:


[sqlexception (0x80131904): an attempt to attach an auto-named database for
file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.]
system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception,
boolean breakconnection) +734995
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) +359
system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection
owningconnection, dbconnectionpool pool, dbconnectionoptions options) +28
system.data.providerbase.dbconnectionpool.createobject(dbconnection
owningobject) +424
system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection
owningobject) +66
system.data.providerbase.dbconnectionpool.getconnection(dbconnection
owningobject) +496
system.data.providerbase.dbconnectionfactory.getconnection(dbconnection
owningconnection) +82
system.data.providerbase.dbconnectionclosed.openconnection(dbconnection
outerconnection, dbconnectionfactory connectionfactory) +105
system.data.sqlclient.sqlconnection.open() +111
system.web.dataaccess.sqlconnectionholder.open(httpcontext context, boolean
revertimpersonate) +84
system.web.dataaccess.sqlconnectionhelper.getconnection(string
connectionstring, boolean revertimpersonation) +197
system.web.security.sqlmembershipprovider.getpasswordwithformat(string
username, boolean updatelastloginactivitydate, int32& status, string&
password, int32& passwordformat, string& passwordsalt, int32&
failedpasswordattemptcount, int32& failedpasswordanswerattemptcount,
boolean& isapproved, datetime& lastlogindate, datetime& lastactivitydate)
+1121
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved, string& salt, int32& passwordformat) +105
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved) +42
system.web.security.sqlmembershipprovider.validateuser(string username,
string password) +83
system.web.ui.webcontrols.login.onauthenticate(authenticateeventargs e) +160
system.web.ui.webcontrols.login.attemptlogin() +105
system.web.ui.webcontrols.login.onbubbleevent(object source, eventargs e)
+99
system.web.ui.control.raisebubbleevent(object source, eventargs args) +35
system.web.ui.webcontrols.button.oncommand(commandeventargs e) +115
system.web.ui.webcontrols.button.raisepostbackevent(string eventargument)
+163
system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string
eventargument) +7
system.web.ui.page.raisepostbackevent(ipostbackeventhandler sourcecontrol,
string eventargument) +11
system.web.ui.page.raisepostbackevent(namevaluecollection postdata) +33
system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint,
boolean includestagesafterasyncpoint) +5102
 
G

Guest

VB Programmer:
What this means is that your hoster or site already has this database
attached (probably their default one). You'll need to either rename your
database and make the appropriate config changes, or work out the details
with them.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




VB Programmer said:
I would appreciate your assistance on this ASP.NET 2.0 site....

This is the wierd problem: While accessing the built in .NET functions for
'profiling' or 'membership' an error is generated (see following 2
examples):

---- EXAMPLE 1 --------
OK --> Dim p As New ProfileCommon
OK --> p = Profile.GetProfile(Me.ddlRacer.SelectedItem.Text)
FAILS --> Me.lblDebug.Text = p.FirstName.ToString

---- EXAMPLE 2 --------
OK --> Dim u As MembershipUser
FAILS --> u =
System.Web.Security.Membership.GetUser(Me.ddlRacer.SelectedItem.Text)

These lines work perfectly locally. They fail after my site is published to
the webserver. I really feel this is a server related issue. Perhaps these
"libraries" are not installed correctly or something? Any ideas?

The error message is misleading and says this:

error received:
----------------------------------
server error in '/' application.
--------------------------------------------------------------------------------

an attempt to attach an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.
des_crip_tion: an unhandled exception occurred during the execution of the
current web request. please review the stack trace for more information
about the error and where it originated in the code.

exception details: system.data.sqlclient.sqlexception: an attempt to attach
an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.

source error:

an unhandled exception was generated during the execution of the current web
request. information regarding the origin and location of the exception can
be identified using the exception stack trace below.

stack trace:


[sqlexception (0x80131904): an attempt to attach an auto-named database for
file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.]
system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception,
boolean breakconnection) +734995
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) +359
system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection
owningconnection, dbconnectionpool pool, dbconnectionoptions options) +28
system.data.providerbase.dbconnectionpool.createobject(dbconnection
owningobject) +424
system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection
owningobject) +66
system.data.providerbase.dbconnectionpool.getconnection(dbconnection
owningobject) +496
system.data.providerbase.dbconnectionfactory.getconnection(dbconnection
owningconnection) +82
system.data.providerbase.dbconnectionclosed.openconnection(dbconnection
outerconnection, dbconnectionfactory connectionfactory) +105
system.data.sqlclient.sqlconnection.open() +111
system.web.dataaccess.sqlconnectionholder.open(httpcontext context, boolean
revertimpersonate) +84
system.web.dataaccess.sqlconnectionhelper.getconnection(string
connectionstring, boolean revertimpersonation) +197
system.web.security.sqlmembershipprovider.getpasswordwithformat(string
username, boolean updatelastloginactivitydate, int32& status, string&
password, int32& passwordformat, string& passwordsalt, int32&
failedpasswordattemptcount, int32& failedpasswordanswerattemptcount,
boolean& isapproved, datetime& lastlogindate, datetime& lastactivitydate)
+1121
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved, string& salt, int32& passwordformat) +105
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved) +42
system.web.security.sqlmembershipprovider.validateuser(string username,
string password) +83
system.web.ui.webcontrols.login.onauthenticate(authenticateeventargs e) +160
system.web.ui.webcontrols.login.attemptlogin() +105
system.web.ui.webcontrols.login.onbubbleevent(object source, eventargs e)
+99
system.web.ui.control.raisebubbleevent(object source, eventargs args) +35
system.web.ui.webcontrols.button.oncommand(commandeventargs e) +115
system.web.ui.webcontrols.button.raisepostbackevent(string eventargument)
+163
system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string
eventargument) +7
system.web.ui.page.raisepostbackevent(ipostbackeventhandler sourcecontrol,
string eventargument) +11
system.web.ui.page.raisepostbackevent(namevaluecollection postdata) +33
system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint,
boolean includestagesafterasyncpoint) +5102
 
V

VB Programmer

But the wierd thing is I can access the data on other pages with no problem.
As a test I made a simple gridview shoping aspnet_users and aspnet_profile
and it showed up fine. It was only when I tried to access the membership or
profile stuff via code that it gave me this error. There are dropdownlists
that are showing the data fine.

Still think it's the db name? I'll give it a try....

Peter Bromberg said:
VB Programmer:
What this means is that your hoster or site already has this database
attached (probably their default one). You'll need to either rename your
database and make the appropriate config changes, or work out the details
with them.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




VB Programmer said:
I would appreciate your assistance on this ASP.NET 2.0 site....

This is the wierd problem: While accessing the built in .NET functions
for
'profiling' or 'membership' an error is generated (see following 2
examples):

---- EXAMPLE 1 --------
OK --> Dim p As New ProfileCommon
OK --> p = Profile.GetProfile(Me.ddlRacer.SelectedItem.Text)
FAILS --> Me.lblDebug.Text = p.FirstName.ToString

---- EXAMPLE 2 --------
OK --> Dim u As MembershipUser
FAILS --> u =
System.Web.Security.Membership.GetUser(Me.ddlRacer.SelectedItem.Text)

These lines work perfectly locally. They fail after my site is published
to
the webserver. I really feel this is a server related issue. Perhaps
these
"libraries" are not installed correctly or something? Any ideas?

The error message is misleading and says this:

error received:
----------------------------------
server error in '/' application.
--------------------------------------------------------------------------------

an attempt to attach an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.
des_crip_tion: an unhandled exception occurred during the execution of
the
current web request. please review the stack trace for more information
about the error and where it originated in the code.

exception details: system.data.sqlclient.sqlexception: an attempt to
attach
an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.

source error:

an unhandled exception was generated during the execution of the current
web
request. information regarding the origin and location of the exception
can
be identified using the exception stack trace below.

stack trace:


[sqlexception (0x80131904): an attempt to attach an auto-named database
for
file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.]
system.data.sqlclient.sqlinternalconnection.onerror(sqlexception
exception,
boolean breakconnection) +734995
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) +359
system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection
owningconnection, dbconnectionpool pool, dbconnectionoptions options) +28
system.data.providerbase.dbconnectionpool.createobject(dbconnection
owningobject) +424
system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection
owningobject) +66
system.data.providerbase.dbconnectionpool.getconnection(dbconnection
owningobject) +496
system.data.providerbase.dbconnectionfactory.getconnection(dbconnection
owningconnection) +82
system.data.providerbase.dbconnectionclosed.openconnection(dbconnection
outerconnection, dbconnectionfactory connectionfactory) +105
system.data.sqlclient.sqlconnection.open() +111
system.web.dataaccess.sqlconnectionholder.open(httpcontext context,
boolean
revertimpersonate) +84
system.web.dataaccess.sqlconnectionhelper.getconnection(string
connectionstring, boolean revertimpersonation) +197
system.web.security.sqlmembershipprovider.getpasswordwithformat(string
username, boolean updatelastloginactivitydate, int32& status, string&
password, int32& passwordformat, string& passwordsalt, int32&
failedpasswordattemptcount, int32& failedpasswordanswerattemptcount,
boolean& isapproved, datetime& lastlogindate, datetime& lastactivitydate)
+1121
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved, string& salt, int32& passwordformat) +105
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved) +42
system.web.security.sqlmembershipprovider.validateuser(string username,
string password) +83
system.web.ui.webcontrols.login.onauthenticate(authenticateeventargs e)
+160
system.web.ui.webcontrols.login.attemptlogin() +105
system.web.ui.webcontrols.login.onbubbleevent(object source, eventargs e)
+99
system.web.ui.control.raisebubbleevent(object source, eventargs args) +35
system.web.ui.webcontrols.button.oncommand(commandeventargs e) +115
system.web.ui.webcontrols.button.raisepostbackevent(string eventargument)
+163
system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string
eventargument) +7
system.web.ui.page.raisepostbackevent(ipostbackeventhandler
sourcecontrol,
string eventargument) +11
system.web.ui.page.raisepostbackevent(namevaluecollection postdata) +33
system.web.ui.page.processrequestmain(boolean
includestagesbeforeasyncpoint,
boolean includestagesafterasyncpoint) +5102
 
V

VB Programmer

I renamed the db to something VERY unique, changed the web.config, etc...

After I published the site I got the same error.

Any more ideas?

Thanks.

VB Programmer said:
But the wierd thing is I can access the data on other pages with no
problem. As a test I made a simple gridview shoping aspnet_users and
aspnet_profile and it showed up fine. It was only when I tried to access
the membership or profile stuff via code that it gave me this error.
There are dropdownlists that are showing the data fine.

Still think it's the db name? I'll give it a try....

Peter Bromberg said:
VB Programmer:
What this means is that your hoster or site already has this database
attached (probably their default one). You'll need to either rename your
database and make the appropriate config changes, or work out the details
with them.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




VB Programmer said:
I would appreciate your assistance on this ASP.NET 2.0 site....

This is the wierd problem: While accessing the built in .NET functions
for
'profiling' or 'membership' an error is generated (see following 2
examples):

---- EXAMPLE 1 --------
OK --> Dim p As New ProfileCommon
OK --> p = Profile.GetProfile(Me.ddlRacer.SelectedItem.Text)
FAILS --> Me.lblDebug.Text = p.FirstName.ToString

---- EXAMPLE 2 --------
OK --> Dim u As MembershipUser
FAILS --> u =
System.Web.Security.Membership.GetUser(Me.ddlRacer.SelectedItem.Text)

These lines work perfectly locally. They fail after my site is published
to
the webserver. I really feel this is a server related issue. Perhaps
these
"libraries" are not installed correctly or something? Any ideas?

The error message is misleading and says this:

error received:
----------------------------------
server error in '/' application.
--------------------------------------------------------------------------------

an attempt to attach an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.
des_crip_tion: an unhandled exception occurred during the execution of
the
current web request. please review the stack trace for more information
about the error and where it originated in the code.

exception details: system.data.sqlclient.sqlexception: an attempt to
attach
an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.

source error:

an unhandled exception was generated during the execution of the current
web
request. information regarding the origin and location of the exception
can
be identified using the exception stack trace below.

stack trace:


[sqlexception (0x80131904): an attempt to attach an auto-named database
for
file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.]
system.data.sqlclient.sqlinternalconnection.onerror(sqlexception
exception,
boolean breakconnection) +734995
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) +359
system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection
owningconnection, dbconnectionpool pool, dbconnectionoptions options)
+28
system.data.providerbase.dbconnectionpool.createobject(dbconnection
owningobject) +424
system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection
owningobject) +66
system.data.providerbase.dbconnectionpool.getconnection(dbconnection
owningobject) +496
system.data.providerbase.dbconnectionfactory.getconnection(dbconnection
owningconnection) +82
system.data.providerbase.dbconnectionclosed.openconnection(dbconnection
outerconnection, dbconnectionfactory connectionfactory) +105
system.data.sqlclient.sqlconnection.open() +111
system.web.dataaccess.sqlconnectionholder.open(httpcontext context,
boolean
revertimpersonate) +84
system.web.dataaccess.sqlconnectionhelper.getconnection(string
connectionstring, boolean revertimpersonation) +197
system.web.security.sqlmembershipprovider.getpasswordwithformat(string
username, boolean updatelastloginactivitydate, int32& status, string&
password, int32& passwordformat, string& passwordsalt, int32&
failedpasswordattemptcount, int32& failedpasswordanswerattemptcount,
boolean& isapproved, datetime& lastlogindate, datetime&
lastactivitydate)
+1121
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved, string& salt, int32& passwordformat) +105
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved) +42
system.web.security.sqlmembershipprovider.validateuser(string username,
string password) +83
system.web.ui.webcontrols.login.onauthenticate(authenticateeventargs e)
+160
system.web.ui.webcontrols.login.attemptlogin() +105
system.web.ui.webcontrols.login.onbubbleevent(object source, eventargs
e)
+99
system.web.ui.control.raisebubbleevent(object source, eventargs args)
+35
system.web.ui.webcontrols.button.oncommand(commandeventargs e) +115
system.web.ui.webcontrols.button.raisepostbackevent(string
eventargument)
+163
system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string
eventargument) +7
system.web.ui.page.raisepostbackevent(ipostbackeventhandler
sourcecontrol,
string eventargument) +11
system.web.ui.page.raisepostbackevent(namevaluecollection postdata) +33
system.web.ui.page.processrequestmain(boolean
includestagesbeforeasyncpoint,
boolean includestagesafterasyncpoint) +5102
 
G

Guest

Yes, renaming to "whatever.mdf" is half the equation; the configuration entry
that specifies it must be changed to match as well. I'd consult with
"WebHost4Life" - whoever they are.

If the guys are any good at all they should be ready, willing and able to
help you sort it out, assuming they expect to earn their monthly fee or
whatever it is.

Here's a blog entry that may provide some insight:

http://petesbloggerama.blogspot.com/2006/01/getting-default-aspnet-web.html

Peter
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




VB Programmer said:
I renamed the db to something VERY unique, changed the web.config, etc...

After I published the site I got the same error.

Any more ideas?

Thanks.

VB Programmer said:
But the wierd thing is I can access the data on other pages with no
problem. As a test I made a simple gridview shoping aspnet_users and
aspnet_profile and it showed up fine. It was only when I tried to access
the membership or profile stuff via code that it gave me this error.
There are dropdownlists that are showing the data fine.

Still think it's the db name? I'll give it a try....

Peter Bromberg said:
VB Programmer:
What this means is that your hoster or site already has this database
attached (probably their default one). You'll need to either rename your
database and make the appropriate config changes, or work out the details
with them.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




:

I would appreciate your assistance on this ASP.NET 2.0 site....

This is the wierd problem: While accessing the built in .NET functions
for
'profiling' or 'membership' an error is generated (see following 2
examples):

---- EXAMPLE 1 --------
OK --> Dim p As New ProfileCommon
OK --> p = Profile.GetProfile(Me.ddlRacer.SelectedItem.Text)
FAILS --> Me.lblDebug.Text = p.FirstName.ToString

---- EXAMPLE 2 --------
OK --> Dim u As MembershipUser
FAILS --> u =
System.Web.Security.Membership.GetUser(Me.ddlRacer.SelectedItem.Text)

These lines work perfectly locally. They fail after my site is published
to
the webserver. I really feel this is a server related issue. Perhaps
these
"libraries" are not installed correctly or something? Any ideas?

The error message is misleading and says this:

error received:
----------------------------------
server error in '/' application.
--------------------------------------------------------------------------------

an attempt to attach an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.
des_crip_tion: an unhandled exception occurred during the execution of
the
current web request. please review the stack trace for more information
about the error and where it originated in the code.

exception details: system.data.sqlclient.sqlexception: an attempt to
attach
an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.

source error:

an unhandled exception was generated during the execution of the current
web
request. information regarding the origin and location of the exception
can
be identified using the exception stack trace below.

stack trace:


[sqlexception (0x80131904): an attempt to attach an auto-named database
for
file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.]
system.data.sqlclient.sqlinternalconnection.onerror(sqlexception
exception,
boolean breakconnection) +734995
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) +359
system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection
owningconnection, dbconnectionpool pool, dbconnectionoptions options)
+28
system.data.providerbase.dbconnectionpool.createobject(dbconnection
owningobject) +424
system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection
owningobject) +66
system.data.providerbase.dbconnectionpool.getconnection(dbconnection
owningobject) +496
system.data.providerbase.dbconnectionfactory.getconnection(dbconnection
owningconnection) +82
system.data.providerbase.dbconnectionclosed.openconnection(dbconnection
outerconnection, dbconnectionfactory connectionfactory) +105
system.data.sqlclient.sqlconnection.open() +111
system.web.dataaccess.sqlconnectionholder.open(httpcontext context,
boolean
revertimpersonate) +84
system.web.dataaccess.sqlconnectionhelper.getconnection(string
connectionstring, boolean revertimpersonation) +197
system.web.security.sqlmembershipprovider.getpasswordwithformat(string
username, boolean updatelastloginactivitydate, int32& status, string&
password, int32& passwordformat, string& passwordsalt, int32&
failedpasswordattemptcount, int32& failedpasswordanswerattemptcount,
boolean& isapproved, datetime& lastlogindate, datetime&
lastactivitydate)
+1121
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved, string& salt, int32& passwordformat) +105
system.web.security.sqlmembershipprovider.checkpassword(string username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved) +42
system.web.security.sqlmembershipprovider.validateuser(string username,
string password) +83
system.web.ui.webcontrols.login.onauthenticate(authenticateeventargs e)
+160
system.web.ui.webcontrols.login.attemptlogin() +105
system.web.ui.webcontrols.login.onbubbleevent(object source, eventargs
e)
+99
system.web.ui.control.raisebubbleevent(object source, eventargs args)
+35
system.web.ui.webcontrols.button.oncommand(commandeventargs e) +115
system.web.ui.webcontrols.button.raisepostbackevent(string
eventargument)
+163
system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string
eventargument) +7
system.web.ui.page.raisepostbackevent(ipostbackeventhandler
sourcecontrol,
string eventargument) +11
system.web.ui.page.raisepostbackevent(namevaluecollection postdata) +33
system.web.ui.page.processrequestmain(boolean
includestagesbeforeasyncpoint,
boolean includestagesafterasyncpoint) +5102
 
K

Ken Arway

VB said:
I renamed the db to something VERY unique, changed the web.config, etc...

After I published the site I got the same error.

If the error you receive is still the one about an already attached DB of the same name, how have you modified the web.config file? It needs to have a <connectionStrings></connectionStrings> section and in that section you need the following tags (in order):
<remove name="LocalSqlServer" />
<add name="LocalSqlServer"
connectionString="data source=YourServerandInstance;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|YourAppDB.mdf;User Instance=true"
providerName="System.Data.SqlClient" />

Obviously, you'll need to modify the server/instance and mdf values. The key is that ASPNET uses the "LocalSqlServer" connection string to do its authorization, etc.
 
V

VB Programmer

Thanks Peter. I've been consulting with them for a week and they finally
now "support sqlexpress". But, they haven't been able to assist yet.

I haven't been able to find a good reference on how to change the default
ASPNETDB.MDF name. I believe I need to create a new SQLExpress provider
with the new name, etc... but haven't been able to find the info pertaining
to this. Of course, I don't have access to their machine.config so
everything would go in the web.config I believe.

Let me know if you have any other suggestions...

Thanks!


Peter Bromberg said:
Yes, renaming to "whatever.mdf" is half the equation; the configuration
entry
that specifies it must be changed to match as well. I'd consult with
"WebHost4Life" - whoever they are.

If the guys are any good at all they should be ready, willing and able to
help you sort it out, assuming they expect to earn their monthly fee or
whatever it is.

Here's a blog entry that may provide some insight:

http://petesbloggerama.blogspot.com/2006/01/getting-default-aspnet-web.html

Peter
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




VB Programmer said:
I renamed the db to something VERY unique, changed the web.config, etc...

After I published the site I got the same error.

Any more ideas?

Thanks.

VB Programmer said:
But the wierd thing is I can access the data on other pages with no
problem. As a test I made a simple gridview shoping aspnet_users and
aspnet_profile and it showed up fine. It was only when I tried to
access
the membership or profile stuff via code that it gave me this error.
There are dropdownlists that are showing the data fine.

Still think it's the db name? I'll give it a try....

message
VB Programmer:
What this means is that your hoster or site already has this database
attached (probably their default one). You'll need to either rename
your
database and make the appropriate config changes, or work out the
details
with them.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




:

I would appreciate your assistance on this ASP.NET 2.0 site....

This is the wierd problem: While accessing the built in .NET
functions
for
'profiling' or 'membership' an error is generated (see following 2
examples):

---- EXAMPLE 1 --------
OK --> Dim p As New ProfileCommon
OK --> p = Profile.GetProfile(Me.ddlRacer.SelectedItem.Text)
FAILS --> Me.lblDebug.Text = p.FirstName.ToString

---- EXAMPLE 2 --------
OK --> Dim u As MembershipUser
FAILS --> u =
System.Web.Security.Membership.GetUser(Me.ddlRacer.SelectedItem.Text)

These lines work perfectly locally. They fail after my site is
published
to
the webserver. I really feel this is a server related issue.
Perhaps
these
"libraries" are not installed correctly or something? Any ideas?

The error message is misleading and says this:

error received:
----------------------------------
server error in '/' application.
--------------------------------------------------------------------------------

an attempt to attach an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.
des_crip_tion: an unhandled exception occurred during the execution
of
the
current web request. please review the stack trace for more
information
about the error and where it originated in the code.

exception details: system.data.sqlclient.sqlexception: an attempt to
attach
an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.

source error:

an unhandled exception was generated during the execution of the
current
web
request. information regarding the origin and location of the
exception
can
be identified using the exception stack trace below.

stack trace:


[sqlexception (0x80131904): an attempt to attach an auto-named
database
for
file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.]
system.data.sqlclient.sqlinternalconnection.onerror(sqlexception
exception,
boolean breakconnection) +734995
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) +359
system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection
owningconnection, dbconnectionpool pool, dbconnectionoptions options)
+28
system.data.providerbase.dbconnectionpool.createobject(dbconnection
owningobject) +424
system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection
owningobject) +66
system.data.providerbase.dbconnectionpool.getconnection(dbconnection
owningobject) +496
system.data.providerbase.dbconnectionfactory.getconnection(dbconnection
owningconnection) +82
system.data.providerbase.dbconnectionclosed.openconnection(dbconnection
outerconnection, dbconnectionfactory connectionfactory) +105
system.data.sqlclient.sqlconnection.open() +111
system.web.dataaccess.sqlconnectionholder.open(httpcontext context,
boolean
revertimpersonate) +84
system.web.dataaccess.sqlconnectionhelper.getconnection(string
connectionstring, boolean revertimpersonation) +197
system.web.security.sqlmembershipprovider.getpasswordwithformat(string
username, boolean updatelastloginactivitydate, int32& status, string&
password, int32& passwordformat, string& passwordsalt, int32&
failedpasswordattemptcount, int32& failedpasswordanswerattemptcount,
boolean& isapproved, datetime& lastlogindate, datetime&
lastactivitydate)
+1121
system.web.security.sqlmembershipprovider.checkpassword(string
username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved, string& salt, int32& passwordformat) +105
system.web.security.sqlmembershipprovider.checkpassword(string
username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved) +42
system.web.security.sqlmembershipprovider.validateuser(string
username,
string password) +83
system.web.ui.webcontrols.login.onauthenticate(authenticateeventargs
e)
+160
system.web.ui.webcontrols.login.attemptlogin() +105
system.web.ui.webcontrols.login.onbubbleevent(object source,
eventargs
e)
+99
system.web.ui.control.raisebubbleevent(object source, eventargs args)
+35
system.web.ui.webcontrols.button.oncommand(commandeventargs e) +115
system.web.ui.webcontrols.button.raisepostbackevent(string
eventargument)
+163
system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string
eventargument) +7
system.web.ui.page.raisepostbackevent(ipostbackeventhandler
sourcecontrol,
string eventargument) +11
system.web.ui.page.raisepostbackevent(namevaluecollection postdata)
+33
system.web.ui.page.processrequestmain(boolean
includestagesbeforeasyncpoint,
boolean includestagesafterasyncpoint) +5102
 
V

VB Programmer

THAT WORKED KEN!!!!

I followed what you said, uploaded the precompiled site, then REMOVED "User
Instance=true" and it works now.

Thanks again!
 
C

clintonG

Ha, this is a hoot Peter.

I think *you* better check with *your* server administrator "whoever that
is" because I selected the URL to read the article you referred to and the
URL was not found by blogger's server.

You know, if their guys are any good at all they should be ready, willing
and able to help you sort it out, assuming they expect to earn their monthly
fee or whatever it is.


<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/


Peter Bromberg said:
Yes, renaming to "whatever.mdf" is half the equation; the configuration
entry
that specifies it must be changed to match as well. I'd consult with
"WebHost4Life" - whoever they are.

If the guys are any good at all they should be ready, willing and able to
help you sort it out, assuming they expect to earn their monthly fee or
whatever it is.

Here's a blog entry that may provide some insight:

http://petesbloggerama.blogspot.com/2006/01/getting-default-aspnet-web.html

Peter
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




VB Programmer said:
I renamed the db to something VERY unique, changed the web.config, etc...

After I published the site I got the same error.

Any more ideas?

Thanks.

VB Programmer said:
But the wierd thing is I can access the data on other pages with no
problem. As a test I made a simple gridview shoping aspnet_users and
aspnet_profile and it showed up fine. It was only when I tried to
access
the membership or profile stuff via code that it gave me this error.
There are dropdownlists that are showing the data fine.

Still think it's the db name? I'll give it a try....

message
VB Programmer:
What this means is that your hoster or site already has this database
attached (probably their default one). You'll need to either rename
your
database and make the appropriate config changes, or work out the
details
with them.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




:

I would appreciate your assistance on this ASP.NET 2.0 site....

This is the wierd problem: While accessing the built in .NET
functions
for
'profiling' or 'membership' an error is generated (see following 2
examples):

---- EXAMPLE 1 --------
OK --> Dim p As New ProfileCommon
OK --> p = Profile.GetProfile(Me.ddlRacer.SelectedItem.Text)
FAILS --> Me.lblDebug.Text = p.FirstName.ToString

---- EXAMPLE 2 --------
OK --> Dim u As MembershipUser
FAILS --> u =
System.Web.Security.Membership.GetUser(Me.ddlRacer.SelectedItem.Text)

These lines work perfectly locally. They fail after my site is
published
to
the webserver. I really feel this is a server related issue.
Perhaps
these
"libraries" are not installed correctly or something? Any ideas?

The error message is misleading and says this:

error received:
----------------------------------
server error in '/' application.
--------------------------------------------------------------------------------

an attempt to attach an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.
des_crip_tion: an unhandled exception occurred during the execution
of
the
current web request. please review the stack trace for more
information
about the error and where it originated in the code.

exception details: system.data.sqlclient.sqlexception: an attempt to
attach
an auto-named database for file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.

source error:

an unhandled exception was generated during the execution of the
current
web
request. information regarding the origin and location of the
exception
can
be identified using the exception stack trace below.

stack trace:


[sqlexception (0x80131904): an attempt to attach an auto-named
database
for
file
c:\hosting\webhost4life\member\robertnzana\customerdomains\1320stompers\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.]
system.data.sqlclient.sqlinternalconnection.onerror(sqlexception
exception,
boolean breakconnection) +734995
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) +359
system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection
owningconnection, dbconnectionpool pool, dbconnectionoptions options)
+28
system.data.providerbase.dbconnectionpool.createobject(dbconnection
owningobject) +424
system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection
owningobject) +66
system.data.providerbase.dbconnectionpool.getconnection(dbconnection
owningobject) +496
system.data.providerbase.dbconnectionfactory.getconnection(dbconnection
owningconnection) +82
system.data.providerbase.dbconnectionclosed.openconnection(dbconnection
outerconnection, dbconnectionfactory connectionfactory) +105
system.data.sqlclient.sqlconnection.open() +111
system.web.dataaccess.sqlconnectionholder.open(httpcontext context,
boolean
revertimpersonate) +84
system.web.dataaccess.sqlconnectionhelper.getconnection(string
connectionstring, boolean revertimpersonation) +197
system.web.security.sqlmembershipprovider.getpasswordwithformat(string
username, boolean updatelastloginactivitydate, int32& status, string&
password, int32& passwordformat, string& passwordsalt, int32&
failedpasswordattemptcount, int32& failedpasswordanswerattemptcount,
boolean& isapproved, datetime& lastlogindate, datetime&
lastactivitydate)
+1121
system.web.security.sqlmembershipprovider.checkpassword(string
username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved, string& salt, int32& passwordformat) +105
system.web.security.sqlmembershipprovider.checkpassword(string
username,
string password, boolean updatelastloginactivitydate, boolean
failifnotapproved) +42
system.web.security.sqlmembershipprovider.validateuser(string
username,
string password) +83
system.web.ui.webcontrols.login.onauthenticate(authenticateeventargs
e)
+160
system.web.ui.webcontrols.login.attemptlogin() +105
system.web.ui.webcontrols.login.onbubbleevent(object source,
eventargs
e)
+99
system.web.ui.control.raisebubbleevent(object source, eventargs args)
+35
system.web.ui.webcontrols.button.oncommand(commandeventargs e) +115
system.web.ui.webcontrols.button.raisepostbackevent(string
eventargument)
+163
system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string
eventargument) +7
system.web.ui.page.raisepostbackevent(ipostbackeventhandler
sourcecontrol,
string eventargument) +11
system.web.ui.page.raisepostbackevent(namevaluecollection postdata)
+33
system.web.ui.page.processrequestmain(boolean
includestagesbeforeasyncpoint,
boolean includestagesafterasyncpoint) +5102
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top