Hi
Can anybody help me with the following question?
Suppose I have the following code, where myTable is already defined
elsewhere:
For Each row In myTable.Rows
' Get an index for the row
Next
Within the loop, I'd like to be able to get hold of the zero based index for
the row being used. I know that I could simply add a variable before the
loop and then increment it within the loop, but I think there is an inbuilt
function to do it e.g. row.GetIndex(), or whatever.
Can anybody help?
Geoff 8 1032
You can use the for statement:
For i as intgeger = 0 to myTable.items.count - 1
' [i] - represent the index of each row
' [myTable.items.item(i)] - represent the item for each row (index)
Next i
"Geoff Jones" wrote: Hi
Can anybody help me with the following question?
Suppose I have the following code, where myTable is already defined elsewhere:
For Each row In myTable.Rows ' Get an index for the row Next
Within the loop, I'd like to be able to get hold of the zero based index for the row being used. I know that I could simply add a variable before the loop and then increment it within the loop, but I think there is an inbuilt function to do it e.g. row.GetIndex(), or whatever.
Can anybody help?
Geoff
You can look at the RowNumber property for a cell in the row.
index = row.Item(0).RowNumber
HTH
--
David Williams, VB.NET MVP
"Geoff Jones" wrote: Hi
Can anybody help me with the following question?
Suppose I have the following code, where myTable is already defined elsewhere:
For Each row In myTable.Rows ' Get an index for the row Next
Within the loop, I'd like to be able to get hold of the zero based index for the row being used. I know that I could simply add a variable before the loop and then increment it within the loop, but I think there is an inbuilt function to do it e.g. row.GetIndex(), or whatever.
Can anybody help?
Geoff
Thanks Alex
However, it isn't possible to do using For Each then? That is, is there no
way of working out the index (using inbuilt members) of the row being
process in the loop?
Geoff
"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:7A**********************************@microsof t.com... You can use the for statement:
For i as intgeger = 0 to myTable.items.count - 1 ' [i] - represent the index of each row ' [myTable.items.item(i)] - represent the item for each row (index) Next i
"Geoff Jones" wrote:
Hi
Can anybody help me with the following question?
Suppose I have the following code, where myTable is already defined elsewhere:
For Each row In myTable.Rows ' Get an index for the row Next
Within the loop, I'd like to be able to get hold of the zero based index
for the row being used. I know that I could simply add a variable before the loop and then increment it within the loop, but I think there is an
inbuilt function to do it e.g. row.GetIndex(), or whatever.
Can anybody help?
Geoff
Hi Geoff,
You make me curious, why would you want to use it and what is than the
benefit of that?
(That for index method very effective in my opinion)
Cor Thanks Alex
However, it isn't possible to do using For Each then? That is, is there no way of working out the index (using inbuilt members) of the row being process in the loop?
Geoff
"Alex Levi" <Al******@discussions.microsoft.com> wrote in message news:7A**********************************@microsof t.com... You can use the for statement:
For i as intgeger = 0 to myTable.items.count - 1 ' [i] - represent the index of each row ' [myTable.items.item(i)] - represent the item for each row (index) Next i
"Geoff Jones" wrote:
Hi
Can anybody help me with the following question?
Suppose I have the following code, where myTable is already defined elsewhere:
For Each row In myTable.Rows ' Get an index for the row Next
Within the loop, I'd like to be able to get hold of the zero based
index for the row being used. I know that I could simply add a variable before
the loop and then increment it within the loop, but I think there is an
inbuilt function to do it e.g. row.GetIndex(), or whatever.
Can anybody help?
Geoff
Hi Cor
Merely being inquisitive :)
Geoff
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:eD**************@TK2MSFTNGP09.phx.gbl... Hi Geoff,
You make me curious, why would you want to use it and what is than the benefit of that? (That for index method very effective in my opinion)
Cor
Thanks Alex
However, it isn't possible to do using For Each then? That is, is there
no way of working out the index (using inbuilt members) of the row being process in the loop?
Geoff
"Alex Levi" <Al******@discussions.microsoft.com> wrote in message news:7A**********************************@microsof t.com... You can use the for statement:
For i as intgeger = 0 to myTable.items.count - 1 ' [i] - represent the index of each row ' [myTable.items.item(i)] - represent the item for each row
(index) Next i
"Geoff Jones" wrote:
> Hi > > Can anybody help me with the following question? > > Suppose I have the following code, where myTable is already defined > elsewhere: > > For Each row In myTable.Rows > ' Get an index for the row > Next > > Within the loop, I'd like to be able to get hold of the zero based index for > the row being used. I know that I could simply add a variable before the > loop and then increment it within the loop, but I think there is an
inbuilt > function to do it e.g. row.GetIndex(), or whatever. > > Can anybody help? > > Geoff > > > >
Hi David,
I can not find that, do you have a link on MSDN for that one?
Cor You can look at the RowNumber property for a cell in the row.
index = row.Item(0).RowNumber
HTH -- David Williams, VB.NET MVP
"Geoff Jones" wrote:
Hi
Can anybody help me with the following question?
Suppose I have the following code, where myTable is already defined elsewhere:
For Each row In myTable.Rows ' Get an index for the row Next
Within the loop, I'd like to be able to get hold of the zero based index
for the row being used. I know that I could simply add a variable before the loop and then increment it within the loop, but I think there is an
inbuilt function to do it e.g. row.GetIndex(), or whatever.
Can anybody help?
Geoff
David,
I can't seem to get your solution to work. Can you point me to some
documentation on the RowNumber method of the Item object of a row?
-Sam Matzen
"David Williams" <Da***********@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com... You can look at the RowNumber property for a cell in the row.
index = row.Item(0).RowNumber
HTH -- David Williams, VB.NET MVP
"Geoff Jones" wrote:
Hi
Can anybody help me with the following question?
Suppose I have the following code, where myTable is already defined elsewhere:
For Each row In myTable.Rows ' Get an index for the row Next
Within the loop, I'd like to be able to get hold of the zero based index
for the row being used. I know that I could simply add a variable before the loop and then increment it within the loop, but I think there is an
inbuilt function to do it e.g. row.GetIndex(), or whatever.
Can anybody help?
Geoff
I think David was using a member of a DataGrid; which wasn't the case I was
dealing with. Good try though!
Geoff
"Samuel L Matzen" <sm*****@slm.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl... David,
I can't seem to get your solution to work. Can you point me to some documentation on the RowNumber method of the Item object of a row?
-Sam Matzen
"David Williams" <Da***********@discussions.microsoft.com> wrote in
message news:BD**********************************@microsof t.com... You can look at the RowNumber property for a cell in the row.
index = row.Item(0).RowNumber
HTH -- David Williams, VB.NET MVP
"Geoff Jones" wrote:
Hi
Can anybody help me with the following question?
Suppose I have the following code, where myTable is already defined elsewhere:
For Each row In myTable.Rows ' Get an index for the row Next
Within the loop, I'd like to be able to get hold of the zero based
index for the row being used. I know that I could simply add a variable before
the loop and then increment it within the loop, but I think there is an
inbuilt function to do it e.g. row.GetIndex(), or whatever.
Can anybody help?
Geoff
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jofio |
last post by:
Hello,
I am a newbie in PHP and I am enthusiastically trying out things. I've
just replaced my
index.html (
file with
index.php
|
by: kosh |
last post by:
I was wondering if there is or there could be some way to pass a generator an
optional starting index so that if it supported that slicing could be made
more efficient. Right now if you do use a...
|
by: skura |
last post by:
I am trying to understand how the data in sql server is stored and
also regarding fill factor and page splitting.
1) My first question what is the difference between Index pages and
Data pages....
|
by: Anita |
last post by:
I have just tested 3 queries using QA. The complete
test information :
------
CREATE TABLE agls1
( fyear char(4) NULL ,
fprefix char(3) NULL ,
fvcno char(20) NULL ,
fdate datetime NULL ,...
|
by: Andr? Queiroz |
last post by:
Hi,
I have a table with 10M records and col A has a index created on it.
The data on that table has the same value for col A on all 10M
records. After that I insert diferent values for that column...
|
by: Sean C. |
last post by:
Helpful folks,
Most of my previous experience with DB2 was on s390 mainframe systems
and the optimizer on this platform always seemed very predictable and
consistent. Since moving to a WinNT/UDB...
|
by: Steph. |
last post by:
I have a List view displaying data in Detail mode with several columns.
How I can get the column index the user clicked on ? (when user click on an item inside the ListView, not on a column...
|
by: bobby_b_ |
last post by:
I have a table where fields 1 and 2 make up the primary key.
Because of this, I have a unique composite index on fields 1 and 2 (as
required by DB2). Now my question is: Fields 1 and 2 are also...
|
by: Russ |
last post by:
Every Python programmer gets this message occasionally:
IndexError: list index out of range
The message tells you where the error occurred, but it doesn't tell you
what the range and the...
|
by: shira |
last post by:
I have done a fair bit of searching, but haven't yet been able to find
an explanation as to why one would set "ignore nulls" to "yes" when
creating an index. I understand what it does (I think),...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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,...
| |