[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2009-06-29
3
Medium Priority
?
367 Views
Last Modified: 2013-11-11
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);
 
        db.SubmitChanges();
        
    }
   }

Open in new window

0
Comment
Question by:Samantha1667
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Expert Comment

by:tpsl
ID: 24742573
Which line r u encountering the error
0
 
LVL 15

Accepted Solution

by:
NazoUK earned 200 total points
ID: 24742983
Your casing on the version viewstate variables is different (version and Version), you're probably not getting anything returned when you fetch that variable.
0
 

Author Closing Comment

by:Samantha1667
ID: 31598147
Thank you very very much!
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question