public FormMain(int id, FormAuth auth) { InitializeComponent(); ctx = new MPEntities(); authForm = auth; UsernameLabel.Text = (from u in ctx.Users where u.user_id == id select u.username).FirstOrDefault(); }
// Form load-close private void FormAuth_Load(object sender, EventArgs e) { ctx = new MPEntities(); ctx.Users.Load(); this.ActiveControl = SignInLabel; }