Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. DataTable Select Method

DataTable Select Method

Scheduled Pinned Locked Moved Database
questioncsharpdata-structuresregexhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    numbrel
    wrote on last edited by
    #1

    In ADO.NET I am able to create an array of DataRows that match my criteria, but only when cboSponsor.Text contains one word. If there is more than one word I get an error message when I am debugging. ------------------------------------------------------------- Code: Dim drFound() As System.Data.DataRow Dim dr As System.Data.DataRow drFound = Me.DsEvent1.EventTbl.Select("OrgName = " & cboSponsor.Text) ------------------------------------------------------------- Error message: An unhandled exception of type 'System.Data.SyntaxErrorException' occurred in system.data.dll Additional information: Syntax error: Missing operand after 'Helpers' operator. ------------------------------------------------------------- In this case, 'Helpers' is the second of two words. How can I code it so it recognizes a phrase? Thanks

    Y 1 Reply Last reply
    0
    • N numbrel

      In ADO.NET I am able to create an array of DataRows that match my criteria, but only when cboSponsor.Text contains one word. If there is more than one word I get an error message when I am debugging. ------------------------------------------------------------- Code: Dim drFound() As System.Data.DataRow Dim dr As System.Data.DataRow drFound = Me.DsEvent1.EventTbl.Select("OrgName = " & cboSponsor.Text) ------------------------------------------------------------- Error message: An unhandled exception of type 'System.Data.SyntaxErrorException' occurred in system.data.dll Additional information: Syntax error: Missing operand after 'Helpers' operator. ------------------------------------------------------------- In this case, 'Helpers' is the second of two words. How can I code it so it recognizes a phrase? Thanks

      Y Offline
      Y Offline
      Yulianto
      wrote on last edited by
      #2

      try drFound = Me.DsEvent1.EventTbl.Select("OrgName = '" & cboSponsor.Text&"'")


      Work hard and a bit of luck is the key to success.

      You don`t need to be genius, to be rich.

      N 1 Reply Last reply
      0
      • Y Yulianto

        try drFound = Me.DsEvent1.EventTbl.Select("OrgName = '" & cboSponsor.Text&"'")


        Work hard and a bit of luck is the key to success.

        You don`t need to be genius, to be rich.

        N Offline
        N Offline
        numbrel
        wrote on last edited by
        #3

        Thank you. Now on to solve the next problem that comes up. :^)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups