Reputation: 201
I created a table named track table and on some user login conditions I inserted initial values on table. Code below
var tracktable = new TrackTable
{
IPAddress = ipadd,
LastLoginResult = "Failed",
LastLoginTime = DateTime.Now,
LoginAttemptStreak = 1,
BlockTime = DateTime.Now,
IsBlocked= "false"
};
model.InsertTrack(tracktable);
On user's following logins the database is updated with new values for each fields
var tracktable = new TrackTable
{
IPAddress = Request.ServerVariables["REMOTE_ADDR"],
LastLoginResult = "Success",
LastLoginTime = DateTime.Now,
LoginAttemptStreak = result.LoginAttemptStreak + 1,
BlockTime = vblocktime,
IsBlocked= "true" //not_updating
};
model.Updatetable(ipadd, tracktable);
The problem I am facing comes in update part. In update part the column LastLoginResult
is updated to Success
. But IsBlocked
column has no change - it is still "false". I am totally confused. What might be causing this problem?
Upvotes: 0
Views: 36
Reputation: 304
you might have missed to pass the value for "IsBlocked" variable in Updatetable() method.
Upvotes: 1