Solved

Membershipuser in winform

Posted on 2013-01-28
4
422 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb stateless example 2 27
VB.NET 2008 - Windows Protected Your PC 7 42
Do Wend Macro not working 22 36
Need to sort columns in DataGridView 4 14
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

808 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