Re: Can a DataTable have foreign keys?
From: John Wood (my-name_at_priorganize-dot-com)
Date: 12/18/04
- Next message: San: "DataSource property"
- Previous message: gwenda: "How can I use an enum as the datasource for a combobox?"
- In reply to: MrNobody: "Can a DataTable have foreign keys?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 17 Dec 2004 20:57:07 -0500
Use the "select" method to do this, where you'd pass in an expression such
as "myfield = 14".
Keep in mind that every select you run, it will be faster the second time -
the first time it builds an index in a hashtable automatically. The index is
deleted when any of the rows are updated. Alternatively you can use the
AddIndex and RemoveIndex (IBindingList methods) to set up the indexes before
the select. Hope that helps.
-- John Wood Blog: http://spaces.msn.com/members/johnwood "MrNobody" <MrNobody@discussions.microsoft.com> wrote in message news:F1C177D0-D4B4-4A87-829E-32415D588CD3@microsoft.com... >I love the feature of DataTable to specify a Primary Key and then be able >to > search by it using the Rows.Find method... > > but is there a way to do this for a foreign or alternate key- i.o.w. to be > able to search in a specific column besides the Primary Key column(s) ??
- Next message: San: "DataSource property"
- Previous message: gwenda: "How can I use an enum as the datasource for a combobox?"
- In reply to: MrNobody: "Can a DataTable have foreign keys?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|