Frans:
I'm in the same camp as Rocky Lhotka regarding database fields and null values. That is, if we don't care about the difference between an empty string and a null, use the empty string. So I'm getting tired of FieldNamesKeepEmptyStringAsValue and looping through the fields to build a list of the ones that should keep "" as the value.
I'd like to see a global property (set at code generation time) or a declarative property on the LLBLGenDataSource such as AllFieldsKeepEmptyStringsAsValue. I'd even be OK if the default was false.
My current approach is to call a helper function:
Sub setStringFields(ByRef entity As IEntity2, ByRef dataSource As LLBLGenProDataSource2)
Dim stringList As New System.Collections.Generic.List(Of String)()
For Each fld As IEntityField2 In entity.Fields
If fld.DataType.ToString.ToLower.EndsWith("string") Then
stringList.Add(fld.Name)
End If
Next
dataSource.FieldNamesKeepEmptyStringAsValue = stringList
End Sub
If you've got a better suggestion, I'll be happy to try it.
Joel Reinford
Data Management Solutions LLC