PostgreSql Membership Provider for ASP.NET 2.0
MSSQL 2005 can be nice, but I want to be free to scale/cluster in the future and can't afford $1500 per machine, and that cost goes way up if I need more enterprise capability. Little did I know that one of the open source alternatives, PostgreSql has matured to the point that even if I had the money, I think I would still choose PostgreSql. I love it! It's simple, fast, and just works. Great admin interface and free for commercial use too! Some day I'd like to give back to that project.
Anyway, the purpose of this post is to thank Andri for his ASP.NET Membership Provider for MySQL, and to release my PostgreSQL Provider based on his work. If you use the providers in ASP.NET 2.0 and use MSSQL Express or some other DB, no more excuses - free yourself and migrate to PostgreSQL! You can download the CSharp source files, and database table script here.

14 Comments:
Bad use for a post and way off topic, but enjoy this jeep review.
http://www.automobilemag.com/reviews/suvs/0610_2007_jeep_wrangler/
Damn Lee are you turning to 'Open Source', never woulda thunk it.
alkonet@comcast.net
Dude your genius.
http://pgfoundry.org/tracker/index.php?func=detail&aid=1000676&group_id=1000140&atid=593
Hello,
I'm trying to create a profile provider for your Membership Provider code. I would like to share some ideas with you, could you email me at arrival123 at gmail.com Hope I hear from you.
Thanks a lot, you saved my life..
I removed the import of Npgsql.Design since it seems it doesn't exists in the new version
Thanks again
The connection is not being open (there is no conn.Open();) in ResetPassword.
i am using your postgresqlprovider,
login problem but create user working well.
please help me
thanks in advance
i need help here Lee. i downloaded the source code and try to run in my local machine but there's an error..
1. The type or namespace name 'Linq' does not exist in the namespace 'System'
2. The type or namepsace name 'Linq' does not exist in the namespace 'System.Xml'
Can u provide me any step to step guide tutorial to set this up?
the "web.config" file must be updated,there are some "errors"
dude,
i downloaded the source code and try to run in my local machine. To create new user works fine but I'm having problem authenticating user using forms authentication and the Login control.
any clue?
First of all, thanks for an excellent provider!
However I found two minor errors that stops everything from working correctly, so here are some fixes for PostgreSqlMembershipProvider.cs:
Line 335
Modify the line so that it reads like this (new users won't be created correctly otherwise):
cmd.Parameters.Add("@PKID", NpgsqlTypes.NpgsqlDbType.Char, 40).Value = providerUserKey.ToString();
validatePassword method
Add these two lines before the "default:" line so that passwords stored in plaintext validates.
case MembershipPasswordFormat.Clear:
return password == dbpassword;
Sorry, I didn't realise I had modified the original file and therefore changed the lines numbers.
The line 335 I'm referring to in my post is actually line 341 in the original file.
The "using Npgsql.Design;" should also be removed, as Dirar found out.
Thanks Lee and eKIK,
first the files helped me a great deal.
I found out the first catch on my own.(Char) the second one would have been a real pain, thanks.
Please Lee update the files so People who don“t read all of the comments get the working version, too.
Post a Comment
Links to this post:
Create a Link
<< Home