Save Method won't work

Save Method won't work

Old forum URL: forums.lhotka.net/forums/t/4320.aspx


SouthSpawn posted on Friday, February 08, 2008

I have a parent object called "Company".

For some aparent reason, when I do a "Company.Save"

It does nothing. It should be calling either the "Protected Overrides Sub DataPortal_Insert()" or "Protected Overrides Sub DataPortal_Update()" events.
 
I put a break point there, and it doesn't even call the events.
 
I am doing this for a webpage, so want am I missing?

Still learning here.
 
Thanks,
Mark

JohnB replied on Friday, February 08, 2008

Mark,

Have you looked at the sample Project Tracker application? It is part of the download.

John

SouthSpawn replied on Friday, February 08, 2008

Yeah I have, it looks like I have everything correct.

JohnB replied on Friday, February 08, 2008

Have you tried reading any data to check if the DataPortal.Fetch is working?

SouthSpawn replied on Friday, February 08, 2008

That's the werid thing about it.
 
The fetch is working fine.

JohnB replied on Friday, February 08, 2008

Kind of tough without seeing any code. Are you sure that your properties are getting updated when  changed and have you checked IsSavable after editing a datafield?

praevsky replied on Friday, February 08, 2008

Can't you "Attach to Process?". 
If you don't hit the first line in Csla DataSource_InsertObject or Csla DataSource_UpdateObject, maybe you haven't made any changes?

SouthSpawn replied on Friday, February 08, 2008

I am running this off of my local server, so there is no need to attach it to process in order to debug it.

JohnB replied on Friday, February 08, 2008

Once you edit a field and click 'Save', how far can you get while debugging? At what point do you loose debugging capability?

JohnB replied on Friday, February 08, 2008

One other thing, have you setup Rocky's sample project and had it run successfully? I would give that a try too. It does not take to long.

SouthSpawn replied on Friday, February 08, 2008

I can set the properties in my parent and child objects.
 
When I click on the Save Button, it does nothing.

sceptical replied on Friday, February 08, 2008

Have you tried to run a Sql Trace on it to see if the sql statement is running?

skagen00 replied on Friday, February 08, 2008

Hi Mark,

One suggestion I would have is to place a breakpoint right at save and just hop through it. You'll notice, for instance, if maybe your binding isn't happening properly and your object doesn't become dirty -- or maybe you have child objects that are dirty but the parent isn't dirty because you forgot to override IsDirty to say base.IsDirty || _childCollection.IsDirty..

Another thing is, are you sure you're set up right to be able to hit breakpoints? Put a "throw exception" in the dataportal methods just to be sure -- if you're not and it croaks all of a sudden, well, maybe it's getting there and you don't know it.

Just a few ideas...

Chris

Edit: I didn't see the whole thread when I posted... so if some of the post isn't applicable just ignore.

SouthSpawn replied on Tuesday, February 12, 2008

Sorry I haven't responded eariler guys.

I have been sick for the last 4 days.
 
I will get back to this soon.
 
Thanks,
Mark

Copyright (c) Marimer LLC