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. General Programming
  3. Visual Basic
  4. Select from a DataTable in VB.NET

Select from a DataTable in VB.NET

Scheduled Pinned Locked Moved Visual Basic
csharpdatabaseregextutorial
7 Posts 3 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.
  • M Offline
    M Offline
    MohammadAmiry
    wrote on last edited by
    #1

    I have a DataSet which has Two tables: TableAll, TableQueried TabelAll has all data available. What I want is to use a command to select only those rows in TableAll and copy them to TabelQueried which are LIKE some pattern. I knew how to do this when I had a database and used connections; but now there is no database. How should I do anything like this command: "SElECT * FROM TABELALL WHERE Data LIKE " & Pattern

    N 1 Reply Last reply
    0
    • M MohammadAmiry

      I have a DataSet which has Two tables: TableAll, TableQueried TabelAll has all data available. What I want is to use a command to select only those rows in TableAll and copy them to TabelQueried which are LIKE some pattern. I knew how to do this when I had a database and used connections; but now there is no database. How should I do anything like this command: "SElECT * FROM TABELALL WHERE Data LIKE " & Pattern

      N Offline
      N Offline
      nlindley7
      wrote on last edited by
      #2

      You could just use a 'For each row' in TableAll, and then check the existing condition that you're looking for (the like) and then when the row meets the condition insert 'row' into TableQueried. Nate Lindley

      M 1 Reply Last reply
      0
      • N nlindley7

        You could just use a 'For each row' in TableAll, and then check the existing condition that you're looking for (the like) and then when the row meets the condition insert 'row' into TableQueried. Nate Lindley

        M Offline
        M Offline
        MohammadAmiry
        wrote on last edited by
        #3

        Thank you for your answer, but in fact this is what I am doing right now! But as a matter of fact, my Table is very huge and I have to do the search many times. If I make a search on all rows for every search, it would be slow. I am looking for faster methods, if any... :((

        N 1 Reply Last reply
        0
        • M MohammadAmiry

          Thank you for your answer, but in fact this is what I am doing right now! But as a matter of fact, my Table is very huge and I have to do the search many times. If I make a search on all rows for every search, it would be slow. I am looking for faster methods, if any... :((

          N Offline
          N Offline
          nlindley7
          wrote on last edited by
          #4

          Why do you want to dump the results into a new table? Why not just fill the original table with a dataset query based on your search option?

          T 1 Reply Last reply
          0
          • N nlindley7

            Why do you want to dump the results into a new table? Why not just fill the original table with a dataset query based on your search option?

            T Offline
            T Offline
            txmrm
            wrote on last edited by
            #5

            If you're using VS 2005, you could also use the ToTable method of the System.Data.DataView class.

            M 2 Replies Last reply
            0
            • T txmrm

              If you're using VS 2005, you could also use the ToTable method of the System.Data.DataView class.

              M Offline
              M Offline
              MohammadAmiry
              wrote on last edited by
              #6

              Thank you, I will give it a try...

              1 Reply Last reply
              0
              • T txmrm

                If you're using VS 2005, you could also use the ToTable method of the System.Data.DataView class.

                M Offline
                M Offline
                MohammadAmiry
                wrote on last edited by
                #7

                Oh This didn't cover what I needed! Thanks anyway!

                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