Sorting on a GUID

  • Thread starter Thread starter STom
  • Start date Start date
S

STom

I have a dataview that I create from my datatable like:
ldvData = New DataView(ds.Tables("MyTable"))

I have a GUID field that I want to sort on:
ldvData.Sort = "ProposedCostID"

Then I get the value and place it in an object field:
lDataSort = Me.ProposedCostID.ToString 'I've tried both with and without
ToString

then a find:
liRowIndex = ldvData.Find(lDataSort)

I get back erratic results for a row index. I can see that I do indeed have
a new GUID and the row is in the table, but the row numbers I get back are
all over the place.

Can a GUID be sorted on? Is there another way to get the row index by using
the GUID?

Thanks.

STom
 
Hi,

It works for me.
What datatype is ProposedCostID?
lDataSort shuld be of GUID type.
 
lDataSort is a type of 'Object'. Did you set yours to a type of 'GUID" and
then it worked?

Thanks.

STom
 
Back
Top