i have a mvc4 vs 11 beta project using an old windows authentication database, when i try to login i get the {"Invalid object name 'dbo.Users'."} errro because the tables are named with the aspnet_ prefix.
I cant really rename the tables, is there a workaround for this. can i tell forms authentication to use prefix? maybe in the connection sting?
i thought my problem was as stated above,but i now think i was nver connecting to the right database.
I can not seem to get it to connect to the existsing sql database, it keeps making a new databbase in app_data. i want to get it to connect to my existsing database. i have tried
<remove name="AspNetSqlMembershipProvider>
but
gives me a error saying can not find provider, i have the connection string correct. not sure what going on, i hav done this many times in vs2010
Ok got it working, i managed to connection had defaultprovider name wrong, and i have changed table names, i did not really want to do this, anyhow its all working
ThatsIT
Participant
1026 Points
388 Posts
dbo.Users and dbo.aspnet_users
Apr 23, 2012 12:20 PM|LINK
i have a mvc4 vs 11 beta project using an old windows authentication database, when i try to login i get the {"Invalid object name 'dbo.Users'."} errro because the tables are named with the aspnet_ prefix.
I cant really rename the tables, is there a workaround for this. can i tell forms authentication to use prefix? maybe in the connection sting?
Thanks
Huske
Contributor
4060 Points
756 Posts
Re: dbo.Users and dbo.aspnet_users
Apr 23, 2012 12:51 PM|LINK
Are you using EF 4.x Code First? There's probably a mapping class somewhere which you can update to point to old aspnet_Users table.
ThatsIT
Participant
1026 Points
388 Posts
Re: dbo.Users and dbo.aspnet_users
Apr 23, 2012 02:27 PM|LINK
i thought my problem was as stated above,but i now think i was nver connecting to the right database.
I can not seem to get it to connect to the existsing sql database, it keeps making a new databbase in app_data. i want to get it to connect to my existsing database. i have tried
<remove name="AspNetSqlMembershipProvider>
but gives me a error saying can not find provider, i have the connection string correct. not sure what going on, i hav done this many times in vs2010
ThatsIT
Participant
1026 Points
388 Posts
Re: dbo.Users and dbo.aspnet_users
Apr 23, 2012 02:48 PM|LINK
Ok got it working, i managed to connection had defaultprovider name wrong, and i have changed table names, i did not really want to do this, anyhow its all working
ThatsIT
Participant
1026 Points
388 Posts
Re: dbo.Users and dbo.aspnet_users
Apr 23, 2012 03:14 PM|LINK
Acually i spoke too soon, still not working, going to start a new thread