<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx</link><description>In my last three blog entries I showed how to use the ASP.Net membership provider in a Windows application. I finished with the problem of storing the current user name and the fact that there is a second overload to the IsUserInRole() function that only</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>thanks </title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1693391</link><pubDate>Fri, 29 May 2009 12:41:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1693391</guid><dc:creator>nerio</dc:creator><description>&lt;p&gt;everything is working fine like im in asp.net &lt;/p&gt;
&lt;p&gt;thanks for your effort&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1693391" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1681332</link><pubDate>Wed, 25 Mar 2009 13:58:04 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1681332</guid><dc:creator>Sujan</dc:creator><description>&lt;p&gt;Thanks, Nice code.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1681332" width="1" height="1"&gt;</description></item><item><title>http://ghjejrpyupyuptlhy.com ghjejrpyupyuptlhy,mjkl9qi7wqyq@representative.com,Good site</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1640641</link><pubDate>Sun, 13 Jul 2008 10:06:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1640641</guid><dc:creator>http://ghjejrpyupyuptlhy.com ghjejrpyupyuptlhy,hnkmx2,mjkl9qi7wqyq@representative.com</dc:creator><description>&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://ghjejrpyupyuptlhy.com"&gt;http://ghjejrpyupyuptlhy.com&lt;/a&gt; ghjejrpyupyuptlhy,&lt;a rel="nofollow" target="_new" href="http://ghjejrpyupyuptlhy.com"&gt;http://ghjejrpyupyuptlhy.com&lt;/a&gt; ghjejrpyupyuptlhy&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1640641" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1631031</link><pubDate>Wed, 04 Jun 2008 08:17:33 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1631031</guid><dc:creator>venky</dc:creator><description>&lt;p&gt;thanks for uy code&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1631031" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1611728</link><pubDate>Fri, 02 May 2008 17:29:30 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1611728</guid><dc:creator>Jerome_data</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I try to implement your code in other example:&lt;/p&gt;
&lt;p&gt;- 1) Winform that call a webservice&lt;/p&gt;
&lt;p&gt;- 2) Webservice with Custom UserNameToken with protected override string AuthenticateToken( UsernameToken token )&lt;/p&gt;
&lt;p&gt;- 3)Sql Server version is Standard version on my Server, but this database is configured by aspnet_regsql.exe.&lt;/p&gt;
&lt;p&gt;All works correctly to create user(like your example) in the webservice, but when i try to validate the user (Membership.ValidateUser(&amp;quot;Maurice&amp;quot;, &amp;quot;Password_1&amp;quot;), i have this error:&lt;/p&gt;
&lt;p&gt;The indicator opening session of instant user is not supported in this version of SQL Server.&lt;/p&gt;
&lt;p&gt;Do you have a idea?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1611728" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1549552</link><pubDate>Fri, 21 Mar 2008 20:33:47 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1549552</guid><dc:creator>olli</dc:creator><description>&lt;p&gt;you need to provide a provider for the roleManager in order to store role information in a database of your choice. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1549552" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1525097</link><pubDate>Tue, 26 Feb 2008 16:21:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1525097</guid><dc:creator>Maurice</dc:creator><description>&lt;p&gt;Hi Adam,&lt;/p&gt;
&lt;p&gt;If I am not mistaken Membership.GetAllUsers() should return an (empty) collection instead of null or Nothing is everything is configured right. Both the Membership.GetAllUsers() and Membership.GetUser(&amp;quot;username&amp;quot;) use the same mechanisms and connection string behind the scene.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1525097" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1524421</link><pubDate>Mon, 25 Feb 2008 22:20:03 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1524421</guid><dc:creator>Adam Right</dc:creator><description>&lt;p&gt;Hi Maurice,&lt;/p&gt;
&lt;p&gt;I can get user list on web form like that;&lt;/p&gt;
&lt;p&gt;-----------&lt;/p&gt;
&lt;p&gt;ListBox1.DataSource = Membership.GetAllUsers();&lt;/p&gt;
&lt;p&gt;ListBox1.DataBind();&lt;/p&gt;
&lt;p&gt;-----------&lt;/p&gt;
&lt;p&gt;But it does not work on windows form, the Membership.GetAllUsers() returns NULL.&lt;/p&gt;
&lt;p&gt;but for one user;&lt;/p&gt;
&lt;p&gt;MembershipUser user = Membership.GetUser(&amp;quot;username&amp;quot;) &lt;/p&gt;
&lt;p&gt;works good.&lt;/p&gt;
&lt;p&gt;Do u have any idea to get the user list for a Windows form ?&lt;/p&gt;
&lt;p&gt;Thanks...&lt;/p&gt;
&lt;p&gt;Adam&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1524421" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1279737</link><pubDate>Sat, 03 Nov 2007 12:47:43 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1279737</guid><dc:creator>Raymond</dc:creator><description>&lt;p&gt;Hi Maurice. I'm currently implementing a custom MembershipProvider and MembershipUser class (inherited).&lt;/p&gt;
&lt;p&gt;What's the difference with regards to the App.Config file?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1279737" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#1103926</link><pubDate>Sun, 12 Aug 2007 00:32:38 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1103926</guid><dc:creator>Kevin</dc:creator><description>&lt;p&gt;Can you give an example of a valid connection string that points to the same database name in a different location?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1103926" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#973094</link><pubDate>Tue, 19 Jun 2007 09:27:35 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:973094</guid><dc:creator>Maurice</dc:creator><description>&lt;p&gt;Are you running a web app? In that case you need to use the HttpContext.Current.User.Identity.Name.&lt;/p&gt;
&lt;p&gt;Otherwise you can try AppDomain.CurrentDomain.SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy.WindowsPrincipal) and see if that makes a difference.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=973094" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#971845</link><pubDate>Mon, 18 Jun 2007 17:33:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:971845</guid><dc:creator>Gary Young</dc:creator><description>&lt;p&gt;Maurice,&lt;/p&gt;
&lt;p&gt;I have a VS.NEt 2002 running on a Windows 2000 server that uses the System.Threading.Thread.CurrentPrincipal.Identity.Name &amp;nbsp;code to capture the &amp;nbsp;user ID. &amp;nbsp;However, it does not work on a Windows 2003 server. &amp;nbsp;Any ideas?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=971845" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#938572</link><pubDate>Sat, 02 Jun 2007 10:34:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:938572</guid><dc:creator>Maurice</dc:creator><description>&lt;p&gt;Hi Edison,&lt;/p&gt;
&lt;p&gt;There are two easy ways of doing this. Either set the LocalSqlServer connection string to point to your own database. The drawback, or advantage depending on your point of view, is that other providers use the same connection string and are. The other solution is to use a different connection string name in the connectionStringName=&amp;quot;LocalSqlServer&amp;quot; line in the app.config. This way you can specify a different database for just the membership provider.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=938572" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#937875</link><pubDate>Fri, 01 Jun 2007 21:13:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:937875</guid><dc:creator>Edison Costa</dc:creator><description>&lt;p&gt;Hi Maurice. Great article. Congratulations. How can i use my own data base (e.g., MyApp.mdf) instead ASPNETDB.MDF ?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Edison&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=937875" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#97630</link><pubDate>Mon, 29 May 2006 13:41:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:97630</guid><dc:creator>Maurice</dc:creator><description>Hi Miquel,&lt;br&gt;&lt;br&gt;Using the following: System.Threading.Thread.CurrentPrincipal.Identity.Name will do the trick.&lt;br&gt;&lt;br&gt;Maurice&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=97630" width="1" height="1"&gt;</description></item><item><title>re: Using the ASP.Net membership provider in a Windows forms application part 4.</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2006/01/15/81140.aspx#92585</link><pubDate>Tue, 25 Apr 2006 22:44:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:92585</guid><dc:creator>Miguel A. Palizada</dc:creator><description>Hi, do you know how can i get the value of User.Identity.Name when a assigned the RolePrincipal straighforward in Thread.CurrentPrincipal?&lt;br&gt;&lt;br&gt;Regards&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=92585" width="1" height="1"&gt;</description></item></channel></rss>