Irwsoft Data Framework

Select a Record/s from View
Brief Information
EditionsProfessional and Ultimate
ProvidersSqlClient, MySql and Oracle.
TopicsSelect from View.
RemarksIDF supports DML syntaxes to View like DML syntaxes to table. Please see Table Query for other DML syntaxes.

This sample will show how to display records from a single view. It will also show how to using conditions in select query.

Example :

  1. Here is PersonView view dataschema class used for this sample codes.
  2. Select records from PersonView view which first name is 'Andy'.
C# code
// Declare and initiate a new instance PersonView.
PersonView person = new PersonView();

// using SqlSelectFromto use select SQL-object
SqlSelectFrom select = new SqlSelectFrom(person);

// Don’t forget to set connection string !
// NOTE : it is optional if the data-schema class using default connection .

select.ConnectionString = "...";  // [OPTIONAL]

// NOTE : if you not specify the column, all columns will be included !
select.Columns.All(person);  // [OPTIONAL]
//        you can filter columns to display selected columns like codes below :
// select.Columns.All(person.PersonID);
// select.Columns.All(person.FirstName);

// Set where condition FirstName = "Andy"
select.Where.Compare(person.FirstName, ComparisonOperator.Equal, "Andy");

// Execute the query and return DataView instance that provide properties and methods to access data
// Note : DataView provide paging feature.

Irwsoft.Data.DataView dv = select.Execute();

How to use Irwsoft Data Framework

Related Topics :

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