New Posts New Posts RSS Feed: SqlWhereClause Change at runtime
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

SqlWhereClause Change at runtime

 Post Reply Post Reply
Author
vinothvdp View Drop Down
Newbie
Newbie
Avatar

Joined: 21-Sep-2007
Location: India
Posts: 27
Post Options Post Options   Quote vinothvdp Quote  Post ReplyReply Direct Link To This Post Topic: SqlWhereClause Change at runtime
    Posted: 23-Jan-2010 at 4:29am
Greets,

i want to change the SqlWhereClause at run time. is this possible please help me out.

Thank you
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 25-Jan-2010 at 9:36am
For DevForce Silverlight, you would not use a SqlWhere clause in a command that you would send to the database.  You would use Linq and send the query to a DevForce EntityManager.
Back to Top
vinothvdp View Drop Down
Newbie
Newbie
Avatar

Joined: 21-Sep-2007
Location: India
Posts: 27
Post Options Post Options   Quote vinothvdp Quote  Post ReplyReply Direct Link To This Post Posted: 28-Jan-2010 at 3:48am
i am using DevForce Classic, can i do here.if can then please give me some sample.
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 28-Jan-2010 at 8:36am
This question belongs in the "DevForce Classic Edition Topics" forum, not the Silverlight forum.

But to answer your question, yes, you can.

In your business object you can add this:

VB:

    Private _newWhereClause As String = "WHERE CLAUSE HERE"

    Public Overrides ReadOnly Property SqlWhereClause() As String
        Get
            Return _newWhereClause
        End Get
    End Property

C#:

private string newWhereClause = "WHERE CLAUSE HERE";

public override string SqlWhereClause()
{
         get
         {
              return newWhereClause; 
         }
}
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 28-Jan-2010 at 9:55am
The simplest way to do this is with a PassthruRdbQuery.  There is an Intermediate Tutorial named "Pass-Through Queries".
 
There is a more complicated way to do this which requires writing some code which executes server-side.  There is an Advanced Tutorial named "Remote Service Methods".
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down