Results 1 to 2 of 2

Thread: Checking the database value null

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    Checking the database value null

    if (OrderLinesDs.Tables[0].Rows[0]["Billing_FAX"]!=null)
    {
    txtFax.Text="";
    }
    else
    {
    txtFax.Text=(string)OrderLinesDs.Tables[0].Rows[0]["Billing_FAX"];
    }
    >>above code checking both the condition.what is the best solutions on this

    Help help

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Here's one way:

    Code:
        if (Convert.IsDBNull(reader["FirstName"])) {
            Response.Write("No soup for you!");
        }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width