EnsureClientKeyColumnExists Method
The EnsureClientKeyColumnExists method ensures that the table schema contains the special client correlation key column.
This column (typically named __ClientKey) is used for client-side correlation (for example, matching rows across changesets or post-save merge flows when the server assigns new primary key values).
/// <summary>
/// Ensures that ClientKey column exists
/// </summary>
public void EnsureClientKeyColumnExists()
Namespace: PocoDataSet.Data
Assembly: PocoDataSet.Data.dll
GUID column with IsNullable = false and adds it to the schema.
using PocoDataSet.Data;
using PocoDataSet.IData;
DataTable table = new DataTable();
table.TableName = "Employee";
table.AddColumn("Id", DataTypeNames.INT32, isNullable: false, isPrimaryKey: true);
// Ensure __ClientKey exists in schema
table.EnsureClientKeyColumnExists();
// Now the schema contains the client correlation column
bool hasClientKey = table.ContainsColumn(SpecialColumnNames.CLIENT_KEY);
// Rows created via AddNewRow() typically populate __ClientKey automatically.
Table of Content POCO DataSet API References POCO DataSet Types DataTable Members
Business Process Programming in .Net
© 2004–2026 Laskarzhevsky Software Inc.
Unless otherwise noted, the content of this website is licensed under the
Creative Commons Attribution 4.0 International License (CC BY 4.0).
Code examples are provided under the MIT License.
You are free to share and adapt the material provided that appropriate
credit is given and any modifications are clearly indicated.
The information provided on this website is for educational purposes only.
The author and publisher make no warranties regarding the completeness
or suitability of the information and are not responsible for any damages
resulting from its use.