.Save on objects loaded from custom SQL

Data Access Application Blocks Forum

.Save on objects loaded from custom SQL

Postby Robspages on Mon Sep 29, 2008 5:02 pm

Hey everyone.

I'm having trouble diagnosing what is going on in my app. I have a series of objects which were loaded from custom stored procedures via .loadFromSql(). One of the 2 objects has a calculated field and both have left outer joins.

I have verified that data has changed in the objects by using the immediate window to check values I know should have been updated, however when I call .save to process the batch I do not see anything hitting the database and of course, going back through the app shows the old data.

Any thoughts?
Thanks,
Rob
Robspages
Lurker
 
Posts: 1
Joined: Mon Sep 29, 2008 4:55 pm

Re: .Save on objects loaded from custom SQL

Postby mgnoonan on Tue Sep 30, 2008 2:09 am

Hi Rob,

Are you using Stored Procs or Dynamic SQL to do the Save()? I'm not sure it matters which, but what does matter is the custom query you used during the Load must contain all of the columns in the source table in order to successfully do the Save(). So for example, the Employees object must contain all the columns from the Employees table in order to do the save, regardless of any extra columns you may have added during the Load.
Matt Noonan
EasyObjects.NET - The O/RM for the Enterprise Library
http://www.easyobjects.net
User avatar
mgnoonan
Expert
 
Posts: 1019
Joined: Tue Sep 14, 2004 3:17 am
Location: Springboro, OH


Return to EasyObjects.NET (Microsoft Enterprise Library)

Who is online

Users browsing this forum: No registered users and 1 guest