Search Result

Collapse
3 results in 0.0022 seconds.
Keywords
Members
Tags
system.dbnull
  •  

  • 'System.DateTime' and 'System.DBNull'

    Hello,

    I'm trying to send a Null value in a DateTime field while calling my stored procedure.

    If I use this first method (short with one line), i got the following error message:

    Code:
    cmd.Parameters["@p_order_date"].Value = (this.OrderDate == DateTime.MaxValue) ? DBNull.Value : this.OrderDate;
    Error Message:
    Type of conditional expression cannot be determined...
    See more | Go to post

  • cj
    Guest started a topic if result = system.dbnull

    if result = system.dbnull

    in the command window I get:

    ? result
    {System.DBNull}
    [System.DBNull]: {System.DBNull}

    I need to check for this in code. I then tested in the command window

    if result = system.DBNull
    'DBNull' is a type and cannot be used as an expression.

    How can I check to see if result is equal system.dbnull in my code?...
    See more | Go to post

  • moondaddy
    Guest started a topic how to test for System.DBNull

    how to test for System.DBNull

    How can I test to see if an object is System.DBNull? I have an event and
    need to get the value from a parameter like this:


    Private Sub ValueChanged(By Val sender As Object, ByVal e As
    System.EventArg s)
    Try
    Dim ID As Int32
    'Next line is suto code. it doesnt compile
    If sender.Value Is System.DBNull Then
    ID = 0
    Else
    ID = sender.Value
    End If


    If I put...
    See more | Go to post
Working...