insert null to mssql when it passed a integer = 0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all
the integer in vb.net can not be null, it always be 0 when it have nothing
however i want to insert null to db when it is 0. how can do it

moreover
how to check a textbox is value? e.g txtbox = 2828828
is it txtbox.text.isinteger?
 
moreover
how to check a textbox is value? e.g txtbox = 2828828
is it txtbox.text.isinteger?

Try
Dim value As Integer = Int32.Parse(txtbox.Text)
Catch
' It wasn't an integer
End Try

/claes
 
Joe said:
any shared function provided by .net

Int32.Parse *is* a shared function provided by .NET
But, as Mark wrote, you can always use IsNumeric instead
i don't want to use error handling things
So basically nothing can ever go wrong in your program?
Cool :-)

/claes
 
Back
Top