RSS 2.0
# Friday, May 21, 2010

Was working on the beginnings of a new project and building up a database just by using a file based database connecting with SQL Express.  When it’s actually deployed, it’ll be on a full SQL Server, so I scripted the database and executed the script on my local SQL Server.  The database already had the membership tables built in.  I also knew that I’d not be connecting to it via sa for obvious reasons, so I created a stripped down SQL account to connect with. Good enough.

So, modify web.config to change the connection string and the each of the provider entries to point to the new connection string.  Simple enough.

Run the application connecting to the server and greeted with this:

The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.

Things that make you go hmmmm…

headscratch 

So, I quickly Google with Bing and find this. http://forums.asp.net/p/985097/1267872.aspx.  Ok, fair enough, I did just script it rather installing it.  So I ran aspnet_regsql to remove everything then ran it again to add it all.  Ok, the schema table that’s mentioned in that article is populated and anything else that might get missed from scripting should be there as well, right?  Right … well…

Run it again and same error.  Ok, change the connection to use sa and run again.  Works.  Ok, permissions issue.  Originally had the permissions set up for the account that I wanted to use for the application:

image

Scrolling up a bit however, I notice a bunch of permissions just for all the membership stuff. 

image

Ah, all I’m using right now is basic reads from the membership stuff, so just gave the account the above permissions and we are in business!

Hope this helps someone else along the way!

Friday, May 21, 2010 12:52:27 PM UTC  #    Comments [0] -
.NET | SQL Server | Visual Studio
Archive
<May 2010>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
George Handlin
Sign In
Statistics
Total Posts: 51
This Year: 0
This Month: 0
This Week: 0
Comments: 9
All Content © 2012, George Handlin
DasBlog theme 'Business' created by Christoph De Baene (delarou)