コード例 #1
0
ファイル: Home.aspx.cs プロジェクト: anon1810/OlderWebApp
 void bindDataMovie()
 {
     using (LoginDBEntities db = new LoginDBEntities()) {
         var d = db.movies.ToList();
         gvMovie.DataSource = d;
         gvMovie.DataBind();
     }
 }
コード例 #2
0
ファイル: Login.aspx.cs プロジェクト: anon1810/OlderWebApp
 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);
         }
     }
 }