I have a question
What do I do if I want to assign a dbnull.value to a column
For example:
The database has a column defined as decimal, where nullvalues are excepted
The storedprocedure has a param @Price as dec
I get dim price as string=pricetextbox.text from the user input
I control the userinput with keypress event
IfNot price= vbNullString Then
Dim x As Decimal = Decimal.Parse(price)
EndIf
cmd.Parameters.AddWithValue("@Price", IIf(price= vbNullString, 0, x))
How do I assign a dbnull.value if the user has not input a value?
I send a 0 value back, but somewhere it has to change to dbnull.value(uninizialized column)
I read c# has nullable types, but vb does not.
How is it handled in vb?
thanks in adv., Richard
What do I do if I want to assign a dbnull.value to a column
For example:
The database has a column defined as decimal, where nullvalues are excepted
The storedprocedure has a param @Price as dec
I get dim price as string=pricetextbox.text from the user input
I control the userinput with keypress event
IfNot price= vbNullString Then
Dim x As Decimal = Decimal.Parse(price)
EndIf
cmd.Parameters.AddWithValue("@Price", IIf(price= vbNullString, 0, x))
How do I assign a dbnull.value if the user has not input a value?
I send a 0 value back, but somewhere it has to change to dbnull.value(uninizialized column)
I read c# has nullable types, but vb does not.
How is it handled in vb?
thanks in adv., Richard