Textbox and binding DbNull Values

  • Thread starter Thread starter Juanjo
  • Start date Start date
J

Juanjo

When I bind a textbox to a typed dataset column that allow null values
(DataType=Decimal), If I enter nothing in the textbox, it doesn't accept the
new value and it goes back to the previous value. Only if the previous value
is nothing it accepts enter nothing.
I have VS.NET2003.

What can I do??

Regards,
Juanjo.
 
Hi Junajo

I believe you are trying to insert null values into table.
If you are using stored procedures (sql server) you could do like thi
Declare @closed_date_time datetim
if Len(LTrim(Rtrim(@closed_date))) >
BEGI
SET @closed_date_time=Convert( datetime,@closed_date,103
EN
els
BEGI
SET @closed_date_time= NUL
EN

and insert @closed_date_time into your table

If you are trying to retrieve null value into your text box you coul
If Not (IsDBNull(dataset.Tables(0).Rows(0).Item("field name"))) The
txtClosedDate.Text = dataset.Tables(0).Rows(0).Item("field name"
End I
though this is better handled in query itsel

Regard
Satish
 
Back
Top