none
How do I create a query to a typed dataset while passing the Where condition as a single string parameter RRS feed

  • Question

  • I am using a typed dataset as my DAL.  In the DataSet designer, I have a dataset, with a tableadapter that has several queries.  One such query with corresponding SQL is listed below:

    Query: GetDataByMissionID(MissionID)   /  Actual SQL:  "Select ... from ... Where ([MissionID]=?)"    / Parameter = Integer [ex. 12]

    I would like to be able to pass the entire WhereClause as a String parameter to the table adapter, such as listed below

    Query: GetDataBySQL(SQL) / Actual SQL: "Select ... from ... Where (?)" / Parameter = String [ex. "(([MissionID]=12) And ([Year]>1990))"]

    Is the above possible?  I am trying to use the existing typed dataset's tableAdapter without having to create my own DAL this time.  BTW, I don't want any update/delete statements generated either.

    Thanks in advance.


    Tim
    Tuesday, June 30, 2009 5:14 PM

Answers