tablename User ID int Email varchar(500) Password varchar(500) Name varchar(500) Country varchar(500) LastLogin datetime RegisterDate datetime Description Varchar(500) ImageName varchar(500)
string chkUser = "Select * FROM [User] where Email='" + UserName + "' AND Password='" + Password + "'"; dt = dbClass.ConnectDataBaseReturnDT(chkUser); if (dt.Rows.Count > 0) { boolReturnValue = true; Session["UserId"] = dt.Rows[0]["Id"].ToString(); string que = "UPDATE [User] SET LastLogin = GETDATE() where Id=" + Session["UserId"].ToString(); what logic i use dbClass.ConnectDataBaseToInsert(que);
Session["UserId"] = dt.Rows[0].ItemArray[1].ToString(); Session["RegDate"] = dt.Rows[0].ItemArray[6].ToString();
// Get RegisterDate from row 0, column: RegisterDate DateTime registerDate = (DateTime)dt.Rows[0]["RegisterDate"];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)