Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Tue, 22 Jul 2008 08:50:01 -0700,    group: microsoft.public.dotnet.general        back       


LinQ. update column with auto generated value   
The problem I'm coming across now is that I can't update such a column, 
because I have set the auto generated value to true, and LINQ won't let me 
change such a value, a la "System.InvalidOperationException: Value of member 
'Activated' of an object of type 'Customers' changed.  A member that is 
computed or generated by the database cannot be changed."

 

This is fine for identity fields, but the field I'm updating is a bit that 
starts off FALSE on every record, and is later updated to TRUE.  How can I 
resolve this, so that when inserting records I don't have to include this 
column, yet when updating records I can change its value?


-- 
Carles Ferrer
date: Tue, 22 Jul 2008 08:50:01 -0700   author:   Roger Tranchez am

RE: LinQ. update column with auto generated value   
Hello Carles,

The symptom sounds very similar to the problem described in the codeproject 
article:
http://www.codeproject.com/KB/linq/SettingDefaultValues.aspx
(see the part of the author set the IsDbGenerated property to true)

The workaround is to hook the Updating and Inserting events of 
LinqDataSource, and reset the LINQ object's default values for insert and 
update. 

Please have a look and let me know whether the article is helpful to you or 
not. If you have any other concerns or questions, DON'T hesitate to tell me.

Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Wed, 23 Jul 2008 04:19:29 GMT   author:   (Jialiang Ge [MSFT])

RE: LinQ. update column with auto generated value   
Hello Carles

I am writing to check the status of the issue on your side. Would you mind 
letting me know the result of the suggestions? If you need further 
assistance, feel free to let me know. I will be more than happy to be of 
assistance. 

Have a great day!

Regards, 
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
date: Mon, 28 Jul 2008 11:11:20 GMT   author:   (Jialiang Ge [MSFT])

RE: LinQ. update column with auto generated value   
Hello Jialiang,

Thanks for response. All perfect,

Bye!!


-- 
Carles Ferrer
MCTS
.NET 2005 and DB developer


""Jialiang Ge [MSFT]"" wrote:

> Hello Carles
> 
> I am writing to check the status of the issue on your side. Would you mind 
> letting me know the result of the suggestions? If you need further 
> assistance, feel free to let me know. I will be more than happy to be of 
> assistance. 
> 
> Have a great day!
> 
> Regards, 
> Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> 
> =================================================
> Delighting our customers is our #1 priority. We welcome your comments and 
> suggestions about how we can improve the support we provide to you. Please 
> feel free to let my manager know what you think of the level of service 
> provided. You can send feedback directly to my manager at: 
> msdnmg@microsoft.com.
> 
> This posting is provided "AS IS" with no warranties, and confers no rights.
> =================================================
> 
>
date: Tue, 5 Aug 2008 09:15:02 -0700   author:   Roger Tranchez am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us