エンティティに問題があり、保存しています。次のようにレコードの値を更新したいと思います。ユーザーが物理的に入力していないときに小数点が発生する
私は他のoensで次のものを使用しますが、キーがすでに存在するというレコードを保存する何らかの理由でここでは機能しません。ここで
_dal.portalEntities.Entry(_custInfo).State = System.Data.Entity.EntityState.Modified;
_dal.portalEntities.SaveChanges();
_dal.portalEntities.Entry(_custInfo).Reload();
は私のメインルーチン
tblPortalUser _users;
_users = _dal.GetUserRecordByEmail(_myuser.EmailAddress.ToLower());
//password is the same warn the user as current
if (PasswordHash.ValidatePassword(password.Text, _users.password) == true)
{
lblerror.Text = "Password choose a password you have not used before";
}else
lblerror.Text = "Current Password is invalid.";
// if password is the same as the confirm password then proceed if not warn the user
if (password.Text == confirmpass.Text)
{
_users.password = PasswordHash.HashPassword(password.Text);
_dal.portalEntities.SaveChanges();
//lets send out the verification codes for the email and sms
_notifications.sendNotification(new Guid(portalbl.BLConstants.resetPasswordEmail), _custInfo.firstName + " " + _custInfo.lastName, "", _custInfo.email.ToLower(), "", "", portalbl.BLConstants.portalNotifications.Email, "");
Response.Redirect(@"~\myaccount\logout.aspx", false);
}
GetUserRecordByEmailある
public tblPortalUser GetUserRecordByEmail(string Email)
{
try
{
tblPortalUser _user;
_user = (from _users in _dal.portalEntities.tblPortalUsers
where _users.EmailAddress.ToLower() == Email
select _users).FirstOrDefault();
return _user;
}
catch (Exception ex)
{
string inner = string.Empty;
if (ex.InnerException != null)
{
inner = ex.InnerException.ToString();
}
return null;
}
}
編集例外iはリンクせずに画像を含める方法はありませんありません申し訳ありません、ここで示している1 スコアが10歳未満の場合
あなたが示してくださいすることができます私たちは何が問題なのかを知ることができ、例外はどこにスローされましたか? –
@TarekAboELkheir編集画面にスクリーンショットを追加しました。既存のレコードを編集しようとしていますので、問題は正直ではありません。 – rogue39nin