locked
Dynamically generated search in datatable (datacube) RRS feed

  • Question

  • Hi,

     

    I have a datatable with 9 columns, lets say a,b,c,d,e,f,g,h,i. Values in every column are only integers (if integers are a problem all could be changed to be only characters). The table can contain several million rows. The combination of entries in a row appears only once, i.e. every row is different to all others rows.

     

    In my programm I would like to select with dynamically generated search conditions, for instance

     

    Select single * from datatable where a=1, c=2, f=3, h=4 or

    Select single * from datatable where b=1, c=2, g=3, h=4, i=5 or

    Select single * from datatable where a=1, b=2, c=3, d=4, e=5, f=6, g=3, d=4 or

    Select single * from datatable where a=1, c=2, f=3, h=4

     

    etc.

     

    Any idea how to implement this?

     

    Thanks in advance

    Uwe

    C#, VS Standard 2005

     

    Monday, October 29, 2007 11:12 PM

Answers

All replies

  • Deleted
    Thursday, November 1, 2007 9:32 PM
  • Thank you Arnshea,

     

    in the meantime I implemented it your way and it works fine with a small datatable with indexes in all columns

    But I read, that the select statement is not performant enough.

    I tried the statement find, but it needs a primary key and is not flexible to select with different filters.

     

    If you or somebody else have another hint ...

     

    Regards

    Uwe

     

     

    Friday, November 2, 2007 5:23 PM
  • Deleted
    Monday, November 5, 2007 10:57 PM