Re: Can a DataTable have foreign keys?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John Wood (my-name_at_priorganize-dot-com)
Date: 12/18/04


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) ?? 


Relevant Pages

  • Re: Speed question
    ... 99% of the time the query above is the one who will be run. ... I do not need this primary key for anything else, I will not query for it. ... have the clustered index (either on PACKET_TIME or on PACKET_CONTRACT, ... > memory the first time and the second time the pages are still in memory. ...
    (microsoft.public.sqlserver.programming)
  • Re: Help with "read" issue please
    ... > Another thing to be aware of it that on some operating systems you could ... > that if you run your program twice it will run faster the second time. ... It's like you were reading my mind. ... heh. ...
    (comp.lang.cpp)
  • Re: Every person in North America needs to read this
    ... I gave her a "neener neener" when GWB won the second time and have been ... While I didn't post it I don't mind being given credit for it. ... My boots were made for walking, so I can always make a quick ...
    (misc.news.internet.discuss)
  • Re: opinions on salary/job prospects on the east coast
    ... Illinois and New Jersey come to mind. ... a second time. ...
    (sci.electronics.design)
  • Re: good tv writing
    ... better the second time around. ... I don't even mind Tony's comadreamthing ... Is that the post-shooting coma dreaming? ...
    (misc.writing)