Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creatin Seq Numbers in a datagrid view

Status
Not open for further replies.

allanmc10

Programmer
Feb 23, 2006
39
GB
can any 1 help i am trying to create a seq number in a datagrid view.

the code i have @ the moment is

for intIndex = 0 to objViasDS.tables("Vias").rows.count - 1
is isdbnull(objViasDS.tables("Vias").rows(intindex).item("Vias Seq") then

objViasDS.tables("Vias").rows(intindex).item("Vias Seq") = 1
Else
objViasDS.tables("Vias").rows(intindex).item("Vias Seq") = objViasDS.tables("Vias").rows(intindex).item("Vias Seq") + 1
Next

it is doing the number sequence but everytime i create a new seq number it does it in descending order

i.e

4321 when i want 1234

Hope you understand

Big Al
 
If I understand correctly..

If you are with SQLServer2005 and DataGridView from a query then you can use this

________________________________________________________
Zameer Abdulla
Help to find Missing people
Take the first step in faith. You don't have to see the whole staircase, just take the first step.
(Dr. Martin Luther King Jr.)
 
Since the seq number is set by looking at the objViasDS.tables("Vias").rows(intindex).item("Vias Seq") value, perhaps you need to ad an ORDER BY clause when filling out the objViasDS.tables("Vias") table.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top