Beispiel #1
0
 void bindDataMovie()
 {
     using (LoginDBEntities db = new LoginDBEntities()) {
         var d = db.movies.ToList();
         gvMovie.DataSource = d;
         gvMovie.DataBind();
     }
 }
Beispiel #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     using (LoginDBEntities entities = new LoginDBEntities()) {
         var result = entities.Users.Where(c => c.Name == txtUsername.Value && c.Pass == txtPassword.Value);
         if (result.Count() > 0)
         {
             Session["Username"] = txtUsername.Value;
             Response.Redirect("Home.aspx?Username="******"&Password=" + txtPassword.Value);
         }
     }
 }