Irwsoft Data Framework

Change Column Aliasname
Brief Information
EditionsAll Editions
DataschemaTable, View and Table-Function.
TopicsUsing Column Aliasname in select syntax.

This sample will show how to change column alias-name on select query using Irwsoft Data Framework.

To set alias name for columns can be done in two ways :

Previous Next

ColumnAttribute

C# code
// You can set default alias-name on AliasName property of Irwsoft.Data.ColumnAttribute class.
// Note : All object of data-schema created will have defined alias-name.

[Column("FirstName", DbType.String, AliasName = "First Name")]
private Column _firstName;

Column Object

C# code
// You can set alias-name on AliasName property of Irwsoft.Data.Column class of properties of dataschema object.

// Declare and initiate a new instance PersonTable for select query.

PersonTable person = new PersonTable();

// set aliasname for each column here...
person.PersonId.AliasName = "Person ID";
person.FirstName.AliasName = "First Name";
person.Status.AliasName = "Available";
person.LeaderId.AliasName = "Manager ID";


SqlSelectFrom select = new SqlSelectFrom(person);

// Don’t forget to set connection string !
select.ConnectionString = "...";

// Select all columns
select.Columns.All(person);

Irwsoft.Data.DataView dv = select.Execute();
Irwsoft Data Ultimate Edition provides comprehensive features of Irwsoft Data Framework and support from irwsoft.