Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
335
DB Null Handling
posted

pls find the attachment file ,

1. how to handle Dbnull error handling

2. i dont want to convert.tostring of dbnull value

3. if it possible to set property only , no need of checking in code

thanks

dbull.zip
  • 23930
    Offline posted

    Hi Saravanan,

    Thank you for contacting Infragistics Developer support.

    In order to sum those values you need to first check if the value is DBNull. That requires a small modification of your code. You should substitute the line on which you got the exception with:

                   Dim value = grdTest.Rows(icount).Cells(“Amount”).Value

                   dblAmount = dblAmount + If( value.Equals(DBNull.Value),Nothing,value)

    For your scenario (trying to get the sum of a column), there is another option. You could use UltraCalcManager and get the value by using its Calculate method.

    I have attached a sample which demonstrates this suggestion.

    Please let me know if you have any additional questions.

    WG_AddToDBNull.zip
  • 23930
    Offline posted

    Hello Saravanan,

    I am just checking about the progress of this issue. Let me know if you need my further assistance on this issue.

    Thank you for using Infragistics Components.