String Variable with "\0"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arulmanoj
    New Member
    • Mar 2009
    • 34

    String Variable with "\0"

    Hi All,

    Am running a SQL query (Select EmpName, Address, PhoneNo, ISNULL(AddressT ype,'') FROM Employee) and assigning the results to a BO property class.
    Later when i access this BO class, the AddressType string variable is having "\0".
    How to check this AddressType string variable whether it has "\0" value.

    I am already using != null, but this is not working.

    Thanks.
    Last edited by Frinavale; Sep 19 '11, 02:10 PM. Reason: Added inline code tags.
  • ramradha
    New Member
    • Sep 2011
    • 1

    #2
    Hi,
    Try using the String.Empty()

    Comment

    • arie
      New Member
      • Sep 2011
      • 64

      #3
      check if
      Code:
       yourString.CompareTo(string.Empty) != 0

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        I was pretty sure that you should be checking for DBNull when working with data retrieved from a database....but then again this is going to depend on how you are retrieving your data.

        -Frinny

        Comment

        Working...