Monday, April 10, 2006

I am probably late to this party, but somehow I recently discover this info so I thought I’d share it anyway. It is possible to use the ASP.NET providers in WinForms. Yes, you may need to read the previous statement again.. go ahead!

 

Ok, so what do you need to do to get the Membership, Roles, Profile, etc, providers to work? Well nothing really… ok just the same things that you would do in ASP.NET. Since the Winforms project templates do not automatically reference “System.Web”, then you will need to add that reference. This of course is achieved using the standard Add Reference window in Visual Studio.

 

 

 

Then, again just like you would in ASP.NET, add the required elements to the “app.Config”.

 

As a refresher this a boiler plate implementation of the standard configuration for memebership …

 

<system.web>

   <membership defaultProvider="SqlProvider"

      <providers>

         <clear />

         <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="MySqlConnection"

            applicationName="MyApplication"

            enablePasswordRetrieval="false"

            enablePasswordReset="true"

            requiresQuestionAndAnswer="true"

            requiresUniqueEmail="true"

            passwordFormat="Hashed" />

      </providers>

   </membership>

</system.web>

 

Lastly, in you project you can use the object model just the same as you would in ASP.NET since the declarative model isn’t exactly available. Hope this was helpful for someone.

4/10/2006 9:57:59 AM (Eastern Standard Time, UTC-05:00)  #    Comments [20]  | 
6/5/2006 3:24:55 PM (Eastern Standard Time, UTC-05:00)
Hey - thanks a bunch! I just came across this post on a Google search trying to do the exact same thing!
12/14/2006 9:50:10 AM (Eastern Standard Time, UTC-05:00)
qwe
12/14/2006 9:50:38 AM (Eastern Standard Time, UTC-05:00)
hi
12/14/2006 9:51:00 AM (Eastern Standard Time, UTC-05:00)
hello
2/6/2007 4:06:19 PM (Eastern Standard Time, UTC-05:00)
Thanks, it was indeed helpful, exactly what I was looking for. :)
Lars Thomas
1/24/2008 1:23:31 PM (Eastern Standard Time, UTC-05:00)
Thanks a ton! Exactly what I needed.
10/12/2010 3:12:45 AM (Eastern Standard Time, UTC-05:00)
Cool blog you got here and thank you for the valuable info. I was thinking about posting on a similar subject on my own blog.
10/12/2010 3:23:36 AM (Eastern Standard Time, UTC-05:00)
Great blog, can't wait to read more next visit!
5/11/2011 1:14:36 PM (Eastern Standard Time, UTC-05:00)
Kewl you souhld come up with that. Excellent!
5/29/2011 3:44:17 AM (Eastern Standard Time, UTC-05:00)
DKQb7u , [url=http://gewbnjqrxgbl.com/]gewbnjqrxgbl[/url], [link=http://bjgnnzjqatfb.com/]bjgnnzjqatfb[/link], http://osaddjmdweev.com/
5/29/2011 8:05:49 PM (Eastern Standard Time, UTC-05:00)
cheap car insurance 1275 cheap auto insurance 51927 cheap auto insurance meao
5/30/2011 7:47:03 PM (Eastern Standard Time, UTC-05:00)
home insurance gtd home insurance ygous car insurance qxbnx
6/1/2011 7:43:16 PM (Eastern Standard Time, UTC-05:00)
tramadol ysou colchicine mdxx acomplia diet no pill prescription required 223719
6/1/2011 10:07:58 PM (Eastern Standard Time, UTC-05:00)
life insurance quotes ivrdyt auto insurance 508539
6/2/2011 7:58:34 PM (Eastern Standard Time, UTC-05:00)
lexapro yupblf accutane 053
6/5/2011 6:54:46 PM (Eastern Standard Time, UTC-05:00)
headache ultram =-( lowest prices for tramadol online 463 synthroid best buy towh
6/5/2011 9:46:12 PM (Eastern Standard Time, UTC-05:00)
accutane 2368 state auto insurance lsdrf
6/6/2011 7:52:23 PM (Eastern Standard Time, UTC-05:00)
propecia :PPP prednisone no prescription %PPP cheap cialis >:-)))
6/7/2011 9:36:41 PM (Eastern Standard Time, UTC-05:00)
viagra 8794 buy auto insurance online 894
6/9/2011 7:42:38 PM (Eastern Standard Time, UTC-05:00)
State Farm Insurance: Fridley 49197 Check Insurance Rates :-(((
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Theme design by Jelle Druyts