Hello
I'm having some difficulty searching a set of rows in a DataRow collection..
This is my question
What would be an efficient way to search any column of an DataRow array
Let me try to explain the context of this question, that will help you understand what I'm looking for..
Assume that I have a collection of rows that came out of a statement like this
dim myRows() as DataRow = myTable.Select("any query"
Now that I have this array of rows, I need to find an specific row that matches certain criteria..
For example, "name = Joe"..
If I look at the available options from intellisense when I type "myRows.", I cannot find any function or method that I can call and pass my further search query for a field "name" that contains "Joe"..
With this scenario in mind, my real problem does not allow me to pass to the "myTable" DataTable one select command already containing "name = 'Joe'" because I don't have access to the DataTable
This portion of the code receives rows, and can only deal with them, not with the original datatable
Back to the question
What would be an efficient way to search any column of an DataRow array
Thanks in advance for any help you can provide
Carlos 2 1618
Hi Carlos,
Because you have not any access to the datatable you have not any tool also.
The datarowcollection.find is excelent for your question, but for that it
has to be the primarykey in the datatable.
When you have a lot of search to do you can of course build a datatable
back.
When it are a few you should use the normal for index loop (and exit that if
you found your row)
I hope this helps,
Cor I'm having some difficulty searching a set of rows in a DataRow
collection... This is my question: What would be an efficient way to search any column of an DataRow array?
Let me try to explain the context of this question, that will help you
understand what I'm looking for... Assume that I have a collection of rows that came out of a statement like
this: dim myRows() as DataRow = myTable.Select("any query")
Now that I have this array of rows, I need to find an specific row that
matches certain criteria... For example, "name = Joe"... If I look at the available options from intellisense when I type
"myRows.", I cannot find any function or method that I can call and pass my
further search query for a field "name" that contains "Joe"... With this scenario in mind, my real problem does not allow me to pass to
the "myTable" DataTable one select command already containing "name = 'Joe'"
because I don't have access to the DataTable! This portion of the code receives rows, and can only deal with them, not
with the original datatable. Back to the question: What would be an efficient way to search any column of an DataRow array?
Thanks in advance for any help you can provide!
Thanks for the ideas, Cor...
I'm thinking about re-building the datatable locally and
then search.
That might be faster for my application.
Thanks again,
Carlos This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tommy Lang |
last post by:
I am working on this project and I need some help/pointers/comments to
get me started, I am stuck.
The program will be used to store information in an array while it is
running.
I need to store...
|
by: Petez |
last post by:
Hi,
I want to declare array of System::Data::DataRow but how?
With single variable I write
System::Data::DataRow^ aRow but statement
System::Data::DataRow^ - not works.
System::Data::DataRow* ...
|
by: Dan |
last post by:
Hi. I'm having a problem with searching a databse entry. I'm new to dotnet
and still trying to figure some things out.
In order to locate a row in an access databse file .mdb, i am using this...
|
by: Allen |
last post by:
Hey all, I have a question for you all. I'm learning vb.net and need some
help. I have two classes one named Customers and one named CustomersDA. I
have to go though Customer for everything. I have...
|
by: Allen |
last post by:
I have a class that returns an arraylist. How do I fill a list box from what
is returned? It returns customers which is a arraylist but I cant seem to
get the stuff to fill a list box. I just...
| |
by: dalaimanoj |
last post by:
Hi experts,
I have a form in which there are 4 textboxes and few command buttons like New, View, Save, Delete. I want to insert the values entered in textboxes are to be stored in an Oracle...
|
by: palmah11 |
last post by:
Hi,
I have a Windows Application in which i am using Janus GRidEx for
displying data. In this Janus Grid i have a check box column.
i want a functionality if user selects checkbox for particula...
|
by: Paulo |
last post by:
DataRow dr = (DataRow)ds.Tables.Rows.ItemArray;
Error 1 Cannot convert type 'object' to 'System.Data.DataRow' C:\Documents
and Settings\Fabio\Meus documentos\Visual Studio...
|
by: myotheraccount |
last post by:
Hello,
Is there a way to convert a DataRow to a StringArray, without looping
through all of the items of the DataRow?
Basically, I'm trying to get the results of a query and put them into
a...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |