does the DataTable know your table has a primary key? make sure in your "select ...", the primary key column is selected, and before you fill the dataset, add something likeDataAdapter1.MissingSchemaAction = MissingSchemaAction.AddWithKey;