Print Page | Close Window

Not In Opperator Using in EntityQuery

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=861
Printed Date: 10-Apr-2025 at 2:10am


Topic: Not In Opperator Using in EntityQuery
Posted By: vinothvdp
Subject: Not In Opperator Using in EntityQuery
Date Posted: 27-Jun-2008 at 4:03am

hai ,

How to use Not In Opperator in EntityQuery any exampale pls tell me
thanks



Replies:
Posted By: davidklitzke
Date Posted: 27-Jun-2008 at 8:29am
Here is an example:
 
Reversing a Condition with the Not Operator

This example introduces the EntityBooleanOp.NOT operator, which reverses the sense of a condition.  Like the OR operator, the NOT operator is applied after the clause to which it applies has been defined.

C#

#region Name Does ! (Contains the Letter 'E')

/// <remarks>

/// select * from "dbo"."Product" where (( not "dbo"."Product"."ProductName" like ?))

/// Params: v0=%E%

/// </remarks>

internal static RdbQuery GetQueryNameDoesNotContainsE() {

  RdbQuery query = new RdbQuery(typeof(Product));

  query.AddClause(Product.ProductNameEntityColumn, EntityQueryOp.Contains, "E");

  query.AddOperator(EntityBooleanOp.Not);

  return query;

}

#endregion

 

VB

 

#Region "Name Does NOT Contains the Letter 'E'"

  ''' <remarks>

  ''' select * from "dbo"."Product" where (( not "dbo"."Product"."ProductName" like ?))

  ''' Params: v0=%E%

  ''' </remarks>

  Friend Shared Function GetQueryNameDoesNotContainsE() As RdbQuery

    Dim query As New RdbQuery(GetType(Product))

    query.AddClause(Product.ProductNameEntityColumn, EntityQueryOp.Contains, "E")

    query.AddOperator(EntityBooleanOp.Not)

    Return query

  End Function

#End Region

 




Print Page | Close Window