Skip to main content
All docs

The 'Key expression is undefined' error occurs when you use LinqServerModeDataSource / EntityServerModeDataSource

Error Description

This error can occur when the LinqServerModeDataSource / EntityServerModeDataSource data sources cannot automatically recognize the key (unique) column from the TableName or QueryableSource specified at runtime.


Do the following to resolve this issue:

protected void LinqServerModeDataSourceInstance_Selecting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceSelectEventArgs e) {  
    e.KeyExpression = UNIQUE_KEY_COLUMN_NAME;