Sorting on a GUID

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
 
M

Miha Markic

Hi,

It works for me.
What datatype is ProposedCostID?
lDataSort shuld be of GUID type.
 
S

STom

lDataSort is a type of 'Object'. Did you set yours to a type of 'GUID" and
then it worked?

Thanks.

STom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top