I'm using a grid (SSUltraGrid) to display a query result and then I'm writing the values inside the grid into a String seperated by returns and then writing it into the database.
The problem I'm finding is that I need to know the number of rows so that I can loop through all the cells as the query result isn't going to always have the same number of rows. How can I determine the number of rows in a grid? With the attached graphic it has 5 rows and I can successfully read that into a string by making the loop from 1 to 5 but I need it to be dymanic.
Also, when I write to the database with it seperated by returns I need to be able to re-open it displaying the results in the grid. Again, I would need to know the number of rows so I can loop through correctly.
If you're doing a query to fill the grid, surely the recordset has a "RecordCount" or equivelant property,
else couldn't you just get a record count as part of an SQL statement?
Thanks Aaron. I've now got the values in the Grid writing into a string like this:
VB Code:
111 222 333 444 555
123 234 345 456 567
001 002 003 004 005
101 202 303 404 505
seperated by tabs and returns that I'm writing into a field in the database.
Obviously when I read it back out from the database I'm going to have to know the number of rows to write it back into the grid. Should I save the "RecordCount" value into a field in the database or is there a better way?