locked
search in multiple tables RRS feed

  • Question

  • User-1693623980 posted

    Hi,

    what's a proper way for searching in multiple tables (for example 7 tables) when database is access?

    I think a simple way is this:

    sql1=select * from tbl_1 where content like '%" + searchtext + "%';
    sql2=select * from tbl_2 where content like '%" + searchtext + "%';
    sql3=....
    .
    .
    .

    sqln=select * from tbl_n where content like '%" + searchtext + "%';

    datatable dt1= result of sql1
    dt2=result of sql2
    .
    .
    .

    dtn=result of sqln

    merge  this datatables and show end result in gridview

    I think in sql server we can do it in tsql via store procedure but what about when database is access?

    thanks

    Sunday, February 9, 2014 7:18 AM

Answers