Hi,
According to your description, I understand you want to get a way to set
NON Unique index to make select method much efficient. Please don't
hesitate to correct me know if I have misunderstood anything here.
In DataTable , the select method will search for the Primary Key. Each
Primary Key should be unique. So that it is not possible to set NON UNIQUE
index to DataTable level.
However, in DataView level, the find/findrows method will search against
Sort property. It is not necessary of UNIQUE constraint on this property.
For this reason, I suggest you may look up for it.
Set DataTableView.sort to the column and select the rows by find method.
DataView dv = new DataView(dt);
dv.Sort = "c1";
dv.FindRows();
http://msdn2.microsoft.com/en-us/library/wtkx6bz9.aspx
[DataView.FindRows Method (Object)]
Hope this helps. If you have anything unclear, please feel free to let me
know. I'm glad to assist you.
Sincerely
Wen Yuan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.