Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,902 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,197 people online right now. Registration is fast and FREE... Join Now!




Querying a Recordset

 
Reply to this topicStart new topic

Querying a Recordset

scalt
16 Jan, 2008 - 04:39 PM
Post #1

D.I.C Head
Group Icon

Joined: 22 Nov, 2007
Posts: 114



Thanked: 3 times
Dream Kudos: 25
My Contributions
Hi

Is it possible to perform a query on a recordset, or is it just easier to perform more queries on the actual database?
I am connecting to an Excel file using ADO, and I'm guessing that repeatedly accessing the file will be slower than repeatedly accessing a recordset (or is it better to simply load everything into an Array and go from there?)

Any help would be great
User is online!Profile CardPM
+Quote Post

PsychoCoder
RE: Querying A Recordset
16 Jan, 2008 - 05:26 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
If it were me, I would populate a DataTable with your query, then throw that into a DataSet, then query it like so

CODE

DataSet1.Tables("TableName").Column("ColumnName")


Remember, a DataSet can hold multiple DataTables

Hope that helps smile.gif
User is online!Profile CardPM
+Quote Post

scalt
RE: Querying A Recordset
21 Jan, 2008 - 02:07 PM
Post #3

D.I.C Head
Group Icon

Joined: 22 Nov, 2007
Posts: 114



Thanked: 3 times
Dream Kudos: 25
My Contributions
Datasets are an option, but I was looking more for an easy way to read specific blocks of rows out of the data
ie
"(SELECT * FROM [Sheet1$] WHERE F2=3)"

There are a lot of rows in col 2 containing 3 and that's a really easy way of selecting them all
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 01:16PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month