Re: Binding INTEGER and use of NULL by Miha
Miha
Thu Feb 19 10:49:52 CST 2004
Hi Raymond,
You might use Binding.Parse event. Example:
textBox1.DataBindings[0].Parse += new ConvertEventHandler(Form1_Parse);
private void Form1_Parse(object sender, ConvertEventArgs e)
{
if (e.Value.ToString() == string.Empty)
e.Value = DBNull.Value;
}
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
"Raymond" <anonymous@discussions.microsoft.com> wrote in message
news:0F85C06C-D82C-47D4-A4A8-424D54C51C90@microsoft.com...
> Hi.
>
> I bind a textbox to a field in the database through CurrencyManager.
Everything works find exept one thing: I cannot type Null, blank, nothing in
the textfield. The property in the database allows NULL but I cannot type
blank in the textbox. Whatever I type that isn't numeric is changed then I
leave the textbox.
>
> There must be an easy way to solve this - but what??
>
> /Raymond