Solved

Membershipuser in winform

Posted on 2013-01-28
4
414 Views
Last Modified: 2013-01-30
I am trying to use Membership.getuser and it keeps erroring out anyone know why
 public int uuid { get; set; }
        Security.MembershipUser selectedUser = Membership.GetUser(Convert.ToInt32(uuid), false); 

Open in new window

A field initializer cannot reference the non-static field, method, or property
0
Comment
Question by:r3nder
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38828917
Where is your this line of code placed?
 Security.MembershipUser selectedUser = Membership.GetUser(Convert.ToInt32(uuid), false); 

Open in new window

0
 
LVL 6

Author Comment

by:r3nder
ID: 38829006
namespace PLM{
    public partial class AddUser : RadForm
    {
public int uuid { get; set; }
        Security.MembershipUser selectedUser = Membership.GetUser(Convert.ToInt32(uuid), false);
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 38829018
That initialization should be moved inside the Load or some method and not outside in a class...
0
 
LVL 6

Author Closing Comment

by:r3nder
ID: 38835934
Worked - thanks
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now