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:
AudioObjectEntity au = new AudioObjectEntity();
au.AudioData = Convert.FromBase64String("test");
adapter.SaveEntity(au);
This doesn't:
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?