|
| |
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
One of the issue with databinding in VS2008 is that is does not have a proper support for nullable columns. The advance databinding property does have a option to specify "Null Value" but it does not seems to accept DBNull.Value or String.Empty. Its hard to believe that such a simple thing is not supported and its frusting and disappointing for many developers. The workaround for this is 1. Trap TextBox.DataBindings("Text").Parse event and set value to null if underlying textbox is empty. 2. or Set TextBox.DataBindings("Text").NullValue = String.Empty Both above are tedious workaround since if there are too many textbox controls on form that you need to write that many no of times in all your Winforms. I decided to go for a loop as below. For i As Integer = 0 To FLOPBindingSource.CurrencyManager.Bindings.Count - 1 FLOPBindingSource.CurrencyManager.Bindings(i).NullValue = String.Empty Next Hope that VS2008 team comes up with a path for us to avoid all this manual workaround. | |
|
|
|
|
|
|
|
|
|