By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,967 Members | 2,211 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,967 IT Pros & Developers. It's quick & easy.

Membership database problems

P: n/a
Hi there,

I have a web application that works fine on my local dev machine. However
I'm having less success on my hosting environment.

When I detach the database for this site, copy it to my hosting environment
and attach it through their interface, I can connect to the database in my
hosting environment through the SQL Management studio, see all stored procs,
functions, tables, and the data in the tables I had entered on my local dev
machine. It looks like it should be all good.

However when I attempt to programmatically access members and roles it's
like the data in the tables isn't there

i.e. going through the ASP.NET membership api for example
Membership.GetAllUsers().Count and Roles.GetAllRoles().Length return 0 and
attempting to login under any of the existing accounts fails.

I've checked the SQL User I'm using to connect to the database and it does
have all the aspnet_Membership roles selected. I've checked that it is
connecting to my database (if I change the connection string I get
sqlexception login failure).

Any suggestions?

TIA

Michael

Jul 19 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Did you change the application name in the database when you moved it?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Michael Lang" <micklang at gmail.comwrote in message
news:OS*************@TK2MSFTNGP06.phx.gbl...
Hi there,

I have a web application that works fine on my local dev machine. However
I'm having less success on my hosting environment.

When I detach the database for this site, copy it to my hosting
environment and attach it through their interface, I can connect to the
database in my hosting environment through the SQL Management studio, see
all stored procs, functions, tables, and the data in the tables I had
entered on my local dev machine. It looks like it should be all good.

However when I attempt to programmatically access members and roles it's
like the data in the tables isn't there

i.e. going through the ASP.NET membership api for example
Membership.GetAllUsers().Count and Roles.GetAllRoles().Length return 0
and attempting to login under any of the existing accounts fails.

I've checked the SQL User I'm using to connect to the database and it does
have all the aspnet_Membership roles selected. I've checked that it is
connecting to my database (if I change the connection string I get
sqlexception login failure).

Any suggestions?

TIA

Michael

Jul 19 '07 #2

P: n/a
I didn't, change it. But I never specified it. Thanks for the clue... it
lead to this post from Scott gu...

http://weblogs.asp.net/scottgu/archi...Providers.aspx

As I never specified the applicationName in the config it defaulted to the
vroot path of my dev application which of course is different to the vroot
on my hosting environment.

Solution: I added the applicationName attribute for my membership and
roleprovider and now it's all good.

Cheers

Michael
"Kevin Spencer" <un**********@nothinks.comwrote in message
news:e2**************@TK2MSFTNGP04.phx.gbl...
Did you change the application name in the database when you moved it?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Michael Lang" <micklang at gmail.comwrote in message
news:OS*************@TK2MSFTNGP06.phx.gbl...
>Hi there,

I have a web application that works fine on my local dev machine.
However I'm having less success on my hosting environment.

When I detach the database for this site, copy it to my hosting
environment and attach it through their interface, I can connect to the
database in my hosting environment through the SQL Management studio, see
all stored procs, functions, tables, and the data in the tables I had
entered on my local dev machine. It looks like it should be all good.

However when I attempt to programmatically access members and roles it's
like the data in the tables isn't there

i.e. going through the ASP.NET membership api for example
Membership.GetAllUsers().Count and Roles.GetAllRoles().Length return 0
and attempting to login under any of the existing accounts fails.

I've checked the SQL User I'm using to connect to the database and it
does have all the aspnet_Membership roles selected. I've checked that it
is connecting to my database (if I change the connection string I get
sqlexception login failure).

Any suggestions?

TIA

Michael


Jul 19 '07 #3

P: n/a
That one burned me too a while back. and I found the same ScottGuthrie
post.
"Michael Lang" <micklang at gmail.comwrote in message
news:OZ**************@TK2MSFTNGP04.phx.gbl...
>I didn't, change it. But I never specified it. Thanks for the clue... it
lead to this post from Scott gu...

http://weblogs.asp.net/scottgu/archi...Providers.aspx

As I never specified the applicationName in the config it defaulted to the
vroot path of my dev application which of course is different to the vroot
on my hosting environment.

Solution: I added the applicationName attribute for my membership and
roleprovider and now it's all good.

Cheers

Michael
"Kevin Spencer" <un**********@nothinks.comwrote in message
news:e2**************@TK2MSFTNGP04.phx.gbl...
>Did you change the application name in the database when you moved it?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Michael Lang" <micklang at gmail.comwrote in message
news:OS*************@TK2MSFTNGP06.phx.gbl...
>>Hi there,

I have a web application that works fine on my local dev machine.
However I'm having less success on my hosting environment.

When I detach the database for this site, copy it to my hosting
environment and attach it through their interface, I can connect to the
database in my hosting environment through the SQL Management studio,
see all stored procs, functions, tables, and the data in the tables I
had entered on my local dev machine. It looks like it should be all
good.

However when I attempt to programmatically access members and roles it's
like the data in the tables isn't there

i.e. going through the ASP.NET membership api for example
Membership.GetAllUsers().Count and Roles.GetAllRoles().Length return 0
and attempting to login under any of the existing accounts fails.

I've checked the SQL User I'm using to connect to the database and it
does have all the aspnet_Membership roles selected. I've checked that
it is connecting to my database (if I change the connection string I get
sqlexception login failure).

Any suggestions?

TIA

Michael



Jul 19 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.