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: Thu, 9 Oct 2008 07:55:01 -0700,    group: microsoft.public.dotnet.framework.adonet        back       


ObjectContext   
I have a instance of ObjectContext created like this:
MyDbEntities myDb = new MyDbEntities(connectionString);

I try to add object like the following
MyObject theObject = new MyObject();
...
myDb.AddObject("MyObjectType", theObject);
myDb.SaveChanges();

If I call to add object code, the first time will be OK and it will fail at 
the 2nd time with the error:
"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 
11:59:59 PM."
I don't have a DateTime field in my object. If I put the add object code 
inside a using(....) statement, the error dissapears. But I don't want to 
open the connection every time I want to add an object.
Any ideas about the reason?
Thanks
date: Thu, 9 Oct 2008 07:55:01 -0700   author:   Roy

Google
 
Web ureader.com


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