Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot add record to datatable after sorting

2 views
Skip to first unread message

Young

unread,
Aug 18, 2009, 1:49:20 AM8/18/09
to
I got a table with just 1 primary key (a short integer field).

If I sort the datatable, I cannot add a new record anymore. I keep getting
an error saying that the record is a duplicate (the primary key is unique
and definitely not a duplicate).

If I don't sort the datatable, then I can add without any problem.

I sort the datatable using these codes:

myTable.DefaultView.Sort = "MYKEY"
myTable = myTable.DefaultView.ToTable.

Can someone please help?

TIA
YL

0 new messages