asp.net提示使用的 SQL Server 版本不支持数据类型“date”
protectedvoidbtn_login_Click(objectsender,EventArgse){stringstrUserName=this.txt_name...
protected void btn_login_Click(object sender, EventArgs e) { string strUserName = this.txt_name.Text.Trim(); string strUserPass = this.txt_pass.Text.Trim(); int strUserType = this.drop.SelectedIndex; if (strUserName == null || "".Equals(strUserName.Trim())) { Response.Write("<script>alert('请您填写您的登录账号!')</script>"); } else if (strUserPass == null || "".Equals(strUserPass.Trim())) { Response.Write("<script>alert('请您填写您的登录密码!')</script>"); } else { if (CatalogAccess.ValidateUser(strUserName, strUserPass, strUserType)) { Session["UserName"] = strUserName; Session["UserPass"] = strUserPass; Session["UserType"] = strUserType; int Loginuser_id = CatalogAccess.GetUserIdByUserName(Session["UserName"].ToString()); DateTime Login_time = DateTime.Now; string Login_ip; if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null) { Login_ip = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString(); } else { Login_ip = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString(); } Logininfor SingleLogin = new Logininfor(); SingleLogin.Loginuser_id = Loginuser_id; SingleLogin.Login_time = Login_time; SingleLogin.Login_ip = Login_ip; if (Logininfor.AddLogininfor(SingleLogin)) { if (strUserType == 0) { Response.Redirect("Default.aspx"); } else if (strUserType == 1) { Response.Redirect("Koimymanger/Default.aspx"); } } else { Response.Redirect("Oooops.aspx"); } } else { Response.Write("<script>alert('您的登录用户名和密码错误!')</script>"); } } }
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询