Select from a DataTable in VB.NET
-
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
-
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
-
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
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... :((
-
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... :((
-
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?
-
If you're using VS 2005, you could also use the ToTable method of the System.Data.DataView class.
Thank you, I will give it a try...
-
If you're using VS 2005, you could also use the ToTable method of the System.Data.DataView class.
Oh This didn't cover what I needed! Thanks anyway!