open access data source where clause

2 posts, 0 answers
  1. bharat veer
    bharat veer avatar
    41 posts
    Member since:
    Dec 2009

    Posted 16 Jun 2011 Link to this post

    i have open access data source control on my page.
    with the help of this control i am binding drop down list.
    oadsUnit is the object of open access data source.
    rcbUnit   is the object of dropdownlist.
                    oadsUnit.ObjectContextProvider = "project.Data.Orm.ProjectModel, project.Data.Orm";
                    oadsUnit.TypeName = "project.Data.Orm.SystemList";
                    oadsUnit.Where = "ListType = \"uofm\" ";
                    oadsUnit.EnableDelete = false;
                    oadsUnit.EnableInsert = false;
                    oadsUnit.EnableUpdate = false;
                    oadsUnit.StoreOriginalValuesInViewState = false;
                    rcbUnit.DataSourceID = "oadsUnit";
                    rcbUnit.DataValueField = "SystemListID";
                    rcbUnit.DataTextField = "ListName";
                    rcbUnit.Items.Insert(0, new RadComboBoxItem("Select Unit...", "0"));

    i have a query in my sqlserver like this

    select  *  from systemlist
    where listtype='uofm' and systemlistid not in
    (select unitlistid from itemunit where itemid=2014)

      oadsUnit.Where = "ListType = \"uofm\" ";
       in this where property how can above mentioned sql query can be given as a string.

  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 17 Jun 2011 Link to this post

    Hello bharat veer,

    You could find the following articles useful:
    -    The IN Extent Clause;
    -    The EXISTS Keyword;
    They demonstrate how to use the EXISTS and IN clauses in OQL queries.
    Hope that helps.

    Damyan Bogoev
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  3. DevCraft banner
Back to Top