I am using a dataadapter only. In the datatable the constraints are there. But Update command only inserts data. Not the constraints. Should I do anything else to make it work ?
// there is no rows in the table now.
SqlDataAdapter adapter = new SqlAdapter("SELECT * FROM EMPLOYEES", connection);
DataSet dataSet = new DataSet("Employees");
adapter.Fill(dataSet);
SqlCommandBuilder builder = new SqlCommandBuilder(adapter);
DataRow newrow = dataSet.Tables[0].NewRow;
// filling the new row with values...
...
..
DataColumn[] primaryKey = {dataSet.Tables[0].Coulmn[0]};
dataSet.Tables[0].PrimaryKey = primaryKey;
adapter.Update(dataSet);
---Row is inserted..but no primary key...
|