.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Error when updating. Supposedly updating ID without being asked.

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net


Server Error in '/' Application.

Value of member 'ID' of an object of type 'Ref' changed.
A member defining the identity of the object cannot be changed.
Consider adding a new object with new identity and deleting the existing one instead.

I get this error whenever I attempt to update an entry. Even an entry that has had nothing altered. I have tried to circumvent it but I think it must be a simple oversight. How could I have caused an ID update using the Edit.aspx page of dynamic data? Thank you in advance for the help!

View Complete Post

More Related Resource Links

An error occuring while updating Microsoft SQL Server 2005

I'm trying to install an update of  Microsoft SQL Server 2005 but an error is always occurring. Error is 737d n sometime 2fe4

Object not set error when updating??


Hi, I get the error: Object reference not set to an instance of an object when i perform an update on my datalist.....???

thanks if you can help!

protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)


        String number = DataList1.DataKeys[e.Item.ItemIndex].ToString();

      = number;

        String UserId = Membership.GetUser().ProviderUserKey.ToString();

        SqlDataSource1.UpdateParameters["[User Id]"].DefaultValue
      = UserId;

        String type =
        String datestart =

Error adding/updating Indexed Column to Upgraded Site


We get the following error when adding or updating an indexed column on an upgraded Discussion Board list (from 2007):

System.ArgumentException: Value does not fall within the expected range.


10/18/2010 11:26:22.56 	w3wp.exe (0x1F10)            	0x13EC	SharePoint Foundation     	Monitoring          	nasq	Medium 	Entering monitored scope (Request (POST:http://SERVER:80/SUBSITE/_layouts/EditIndex.aspx?List=544ad227-32bf-4d68-88e6-1a84eb761e8b))	 
10/18/2010 11:26:22.56 	w3wp.exe (0x1F10)            	0x13EC	SharePoint Foundation     	Logging Correlation Data   	xmnv	Medium 	Name=Request (POST:http://SERVER:80/SUBSITE/_layouts/EditIndex.aspx?List=544ad227-32bf-4d68-88e6-1a84eb761e8b)	66aa366d-ac57-4d3f-85b7-9ed0da55f878
10/18/2010 11:26:22.56 	w3wp.exe (0x1F10)            	0x13EC	SharePoint Foundation     	Logging Correlation Data   	xmnv	Medium 	Site=/	66aa366d-ac57-4d3f-85b7-9ed0da55f878
10/18/2010 11:26:22.90 	w3wp.exe (0x1F10)            	0x13EC	SharePoint Foundation     	Runtime            	tkau	Unexpected	System.ArgumentException: Value does not fall within the expected range.  at Microsoft.SharePoint.SPFieldIndexCollection.Add(ArrayList fields)   at Microsoft.SharePoint.SPFieldIndexCollection.Add(SPField primaryField, SPField secondaryField)   at Microsoft.SharePoint.ApplicationPages.EditIndexPage.CreateIn

Error updating MySite profile in sharepoint (MOSS) - An unknown user profile error has occurred. Tr


We come across an error stating "An unknown user profile error has occurred.  Try recreating this user profile or updating this user profile from the directory service to resolve this problem". 

This scenario is observed only for a particular account. The User has got 3 profiles with different accounts.

Problem seems to be only on Production server while on PreProduction & Test server its working fine. 

We have even tried deleting the user profile and recreate, but still the account is not accepting any profile changes. Also checked in the logs files but it didn't give any clue for the issue. 

Is there any specific reason for this behaviour? 





After updating, the error occur at ODBC driver


Hi everyone,

I am maintaining a website of a department in my school.
The web about database (using SQL and .asp files to connect the database *.mdb) works  normally before.

Without any modification about the files but updated the Windows Server 2003 , the web suddenly get wrong.

Every time I open the web that connect to the database, it always show up the following message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver].... 'Temporary (volatile) Jet DSN for process 0x980 Thread 0x166c DBC 0x7c161cc Jet'?

For solving the problem, I found out the error may about the ODBC driver, 
It said some path are cleared by the updating. 
However the setup is already done when I took the job, therefore I don't know how to find the path back about setting ODBC driver.
Could anyone help me

Gettin error in Updating user field using object model



I have multiple site collections and I have to update user filed in each site collection for particular user say X to Y.Now the problem is that display name of user X is resolved in different way in different site collection.In some site collection user x shows correct names and items get updated while in some it takes display name as login name and the query which i created fails.

How to resolved this user issue?

Error: Updating Site Content Type Failed - InfoPath 07/SharePoint 07


I have been working with InfoPath07 and SharePoint Moss 07 for two years.  I have recieved the Updating Content Type error in the past which I got around by creating new library's. This was over a year ago and happened only a couple times.

Recently, my dept did a database migration.  About 3 weeks prior to the migration I started having troubles with publishing InfoPath.

First issue, it would take about three hours for my form to go through to the form/document library.  Sometimes they would publish, other times I would get Updating Content Type Failed.

Now that our databases have been migrated, I don't have to wait three hours to get my error.  I get my error on (1)existing forms that just needed interface updated (no changes to forms content), (2) existing forms that have no content at all, (3) and brand new forms that have never existed, with no content.

I have tried:

  • Deleting some content (fields)
  • Deleting all content
  • Deleting the entire library and starting fresh (including any content types in Central Admin or workflows associated)
  • Creating a brand new form with no content type

I have been researching and trying to figure this issue out for at least three months. I am still getting this error with every form I publish to update the forms library; howe

D3DImage stops updating it's front buffer without exception or error code on XP

I encountered this very strange behaviour of D3DImage, which is only reproducible on XP. The following bug? doesn't seem to occur on any other OS.

The D3DImage has a correct backbuffer set up. I checked the bytes of the backbuffer, and they are updated. (Also updates are visible on other OS.) Still the following code doesn't appear to update the front buffer, without any warning whatsoever.

                    new Int32Rect(

Error updating JScript IntelliSense:[Path]\jquery-1.6.1-vsdoc.js: Syntax error @ 1504:14


Error updating JScript IntelliSense:[Path]\jquery-1.6.1-vsdoc.js: Syntax error @ 1504:14

Any idea why this error is occurring? I am trying to use Jquery IntelliSense in Visual Studio 2008 SP1 with hotfix KB958502 installed.

Data Points: Updating Data in Linked Servers, Information Schema Views, and More


Every day a developer somewhere needs to write code to iterate through SQL ServerT system objects, query and update tables in linked servers, handle optimistic concurrency, and retrieve column and stored procedure metadata.

John Papa

MSDN Magazine November 2004

Timers: Implement a Continuously Updating, High-Resolution Time Provider for Windows


The timestamps that you can obtain from Windows NT are limited to a maximum resolution of 10 or 15 milliseconds, depending on the underlying hardware. At times, such as when you need to timetag frequent events, it is desirable to achieve a higher resolution. For example, what if you want to be able to contact a thread or perform some other task at intervals more frequent than 10 milliseconds? Suggested ways of achieving better resolution include using performance counters in conjunction with the sytem time to calculate smaller time increments. But using performance counters is a technique that presents its own problems. This article shows one possible way of overcoming limitations inherent in this approach.

Johan Nilsson

MSDN Magazine March 2004

BITS: Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API


Both the .NET Framework and Windows have some very interesting APIs for creating applications that are capable of updating themselves automatically over a network. There are many advantages to writing your application to update itself like Windows Update does, including convenience for your users, from easier maintenance to network administration. Automatic updates require attention to factors such as discovery, security, and file replacement. In this article, the author covers the BITS API as well as a number of features of the .NET Framework that take care of these facets of auto-updating using the same facilities that the Windows Update uses.

Jason Clark

MSDN Magazine February 2003

Roles not updating


I have all my code in my other post about checkboxlist issue, but it boils down to, once i find someone doing my search, it displays their permissions as checkboxes. But if i want to remove a permission and click update, the update doesnt seem to occur, if i search on myself, it returns me with my permissions already checked. I uncheck 1 permission, click update and the checkbox is checked again as the page posts.

Original Post:

My aspx page seems pretty simple:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>Enter UserName: 
        <asp:TextBox ID="TxtUserName" runat="server" /><asp:Button ID="LookupBtn" runat="server" Text="Search" onclick="LookupBtn_Click" />  
    <div class="roleList">
        <asp:CheckBoxList ID="RoleList" runat="server" /><br />
        <asp:button ID="UpdateBtn" text="Update" Visible="false" runat="server" onclick="UpdateBtn_Click" />

My update button event and update method:

Stored Procedures & SqlDataAdapter not updating a calendar control


Hi all,

I have a database linked to a calendar. I had a peice of code that retrieved dates from a database and populated the calendar. I wanted to tidy up my code using stored procedures (they seem neater & i assume there's a benefit somewhere). so i came up with this, however it's not working. The calendar displays, but it's not being populated with the database entries. The SqlCommand & SqlParameter I have working elsewhere in my code; as with the SqlDataAdapter (which also worked before i tried to conver to a stored procedure!) but combining these three (SqlCommand, SqlParameter & SqlDataAdapter) seem to be causing me problems.

It's probably something stupid but if someone could take a look and point me in the right direction, I'd be very grateful.


Public Sub dbConnection()
        dbConnString = ConfigurationManager.ConnectionStrings("connString").ConnectionString
        sqlConn = New SqlConnection(dbConnString)
    End Sub

Public Sub EquipmentDDLSelection()

        Dim dbCMD As New SqlCommand("PopulateCalendar", sqlConn)
        dbCMD.CommandType = CommandType.StoredProcedure

        Dim parameterBookedEvents As New SqlParameter("@bookedEvents", SqlDbType.VarChar, 50)

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend