You must Sign In to post a response.
  • Category: .NET

    How can write this statement into c# language.

    vb6 statement: If Not IsNull(rst.Fields(jCount).Value)
  • #586340
    if(rst.Fields[jCount].Value!=null)
    {
    //your code
    }

  • #586344
    Hi,

    Try this,


    if(rst.Fields[jCount].Value != null)
    {
    //Code will be executed, If the condition is true,
    }
    else
    {
    //Code will be executed, If the condition is false,
    }

    Thanks and Regards,
    SAKTHI GOPINATH S
    http://www.mstechs.blogspot.com

  • #586384
    if(rst.Fields[jCount].Value != null)
    {
    // code
    }
    else
    {
    //code
    }

  • #586387
    try this code



    if (!IsNull(rst.Fields(jCount).Value))

    {
    //write your code
    }
    else
    {
    //your code
    }



    hope this will help you

  • #586826
    Hi,

    The above code is for datareader. You can also write this

    if(objdr["jCount"]!=DbNull.Value)
    {

    }


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.