• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 369
  • Last Modified:

ASP.NET ChangeConflictException; "No row found or changed"

I cant resolve this error.  I'm using Linq to SQL and I can't get this to resolve.  I'm the only one touching this data so it's not a matter of more than one person hitting the data.
using System;
using System.Configuration;
using System.Data;
using System.Data.Linq;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CPMS_DAL;
public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e)
        CPMSDataContext db = new CPMSDataContext();
        tbl_Account Account = db.tbl_Accounts.Single(ua => ua.Company_Name == "Test_Company");
        ViewState["AcctID"] = Account.AcctID;
        ViewState["version"] = Account.version;
        ViewState["CreateDate"] = Account.CreateDate;
    protected void BtnUpdate_Click(object sender, EventArgs e)
        //Create an Account object and set the properties
        tbl_Account Account = new tbl_Account()
            Company_Name = "Testing_company",
            UpdateDate = DateTime.Now,
            UpdateByID = 55
        Account.AcctID = Convert.ToInt32(ViewState["AcctID"]);
        Account.version = (Binary)ViewState["Version"];
        Account.CreateDate = Convert.ToDateTime(ViewState["CreateDate"]);
        CPMSDataContext db = new CPMSDataContext();
        db.tbl_Accounts.Attach(Account, true);

Open in new window

1 Solution
Which line r u encountering the error
Your casing on the version viewstate variables is different (version and Version), you're probably not getting anything returned when you fetch that variable.
Samantha1667Author Commented:
Thank you very very much!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now