Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Minimal Table - SaveEntity
 

Pages: 1
LLBLGen Pro Runtime Framework
Minimal Table - SaveEntity
Page:1/1 

  Print all messages in this thread  
Poster Message
obzekt
User



Location:

Joined on:
29-Apr-2004 18:18:59
Posted:
49 posts
# Posted on: 18-Aug-2004 15:51:05.  
Hello. I have a table with only two columns: a PK IDENTITY and a binary one which allows NULL. I'm trying to save new entities but it doesn't work unless I set a value for the second column. This works:

Code:
AudioObjectEntity au = new AudioObjectEntity();
au.AudioData = Convert.FromBase64String("test");
adapter.SaveEntity(au);


This doesn't:

Code:
AudioObjectEntity au = new AudioObjectEntity();
adapter.SaveEntity(au);


In the above, no exception is thrown, just that no new record is created in the DB, although it should, since "AudioData" is not a required field. Any ideas?
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37870 posts
# Posted on: 18-Aug-2004 16:21:39.  
obzekt wrote:
Hello. I have a table with only two columns: a PK IDENTITY and a binary one which allows NULL. I'm trying to save new entities but it doesn't work unless I set a value for the second column. This works:

Code:
AudioObjectEntity au = new AudioObjectEntity();
au.AudioData = Convert.FromBase64String("test");
adapter.SaveEntity(au);


This doesn't:

Code:
AudioObjectEntity au = new AudioObjectEntity();
adapter.SaveEntity(au);


In the above, no exception is thrown, just that no new record is created in the DB, although it should, since "AudioData" is not a required field. Any ideas?

it doesn't fail but simply doesn't save anything as no field is changed, i.e. the entity isn't dirty.

binary would result in a byte[] property, so you could do:
au.AudioData = null;
adapter.SaveEntity(au);

which would save a record as AudioData is changed. Correct?


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
obzekt
User



Location:

Joined on:
29-Apr-2004 18:18:59
Posted:
49 posts
# Posted on: 18-Aug-2004 16:45:00.  
Thanks Otis, setting it to null works!
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.