Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Brain Freeze
Message
 
 
To
20/05/2014 22:43:41
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01600361
Message ID:
01600364
Views:
64
>>>I want to organize rows in a datatable into 3 columns without scanning the table using a counter.
>>>My brain just won't work on this one.
>>>
>>>Assuming that I know rownumber r, is there a mathematical function using r that will return the proper column (1,2 or 3) for each row?
>>
>>I am not sure I understand the question.
>>
>>myDataTable.Rows[rowNumber].Columns[0]
will return value for the first column. (rowNumber is 0 based)
>
>rownumber 1 would be column 1, rownumber 2 would be column 2, rownumber 3 would be column 3, 4 would be 1, 5 would be 2, 6 would be 3, 7 would be 1 etc.
>Is there a mathematical function using rownumber that will return the column number?

I am still confused and I am going out, but looks like you need to consider modulus operator of division by 3.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform