SQL Search

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jollywg
    New Member
    • Mar 2008
    • 158

    SQL Search

    I'm trying to figure out how to use SQL to search for a record and return a Boolean value to tell me whether its there or not.

    Thanks in advance!!
    Jolly
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Database How two parts 1 and 2

    Comment

    • Jollywg
      New Member
      • Mar 2008
      • 158

      #3
      thanks for the post, but i didnt see anything that would actually let me store the result of a boolean value

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        I'm trying to figure out how to use SQL to search for a record and return a Boolean value to tell me whether its there or not.
        thanks for the post, but i didnt see anything that would actually let me store the result of a boolean value
        These two questions aren't really the same thing, but addressing the original question...
        Search for a record, which I am sure was in the tutorials.
        If the returned results contain the record set your boolean to true.

        Comment

        • semomaniz
          Recognized Expert New Member
          • Oct 2007
          • 210

          #5
          first create a boolean and set it to true, then declare the sql statements and then execute it and assign it to a Datareader. then check for if reader has rows. if no rows return false.

          Comment

          • Jollywg
            New Member
            • Mar 2008
            • 158

            #6
            semomaniz: how do i check to see if the reader has rows (select count?) once I do that how do assign that SQL to a C# variable?

            Comment

            • Jollywg
              New Member
              • Mar 2008
              • 158

              #7
              semomaniz: I got it figured out.

              Thanks for the posts everyone!

              Comment

              • semomaniz
                Recognized Expert New Member
                • Oct 2007
                • 210

                #8
                I am glad you did figure out

                Comment

                Working...