Irwsoft Data Framework

Conditional in Irwsoft Data Framework
Brief Information
EditionsAll Editions
TopicsUsing conditional syntax.
SyntaxesWhere, On and Having.

There are many conditional syntax in sql like where, on and having. They are supported by Irwsoft Data Framework. The classes represents them are implements Irwsoft.Data.IComplexCondition, so how to use them are generally same.

This sample will show how to use where syntax in common select query.

Note :

  • This sample apply to all where syntax of update query and delete query.
  • This sample apply to having syntax of group-by syntax.
  • This sample apply to on syntax of joins syntax.

C# code
// 1) Compare condition : this common condition to compare a value against other value
select.Where.Compare( person.FirstName, ComparisonOperator.Equal, "Andy");

// you can even compare simple data 1 = 1
select.Where.Compare( 1, ComparisonOperator.Equal, 1);

// 2) Between condition : condition between min. Value and max. value
select.Where.Between(person.PersonId, 1, 10);

// 3) Like condition : condition with prefix of FirstName is Andy
select.Where.Like(person.FirstName, "Andy%");

// 4) In condition : PersonId equal to one of this values
select.Where.In(person.PersonId, 2, 4, 6, 8, 10, 15);

// Logical Operator : And

// Logical Operator : Or

// Open Curve Bracket

// Close Curve Bracket

Related Topics :

Irwsoft Data Ultimate Edition provides all enhanced features of Irwsoft Data Framework and support from irwsoft.