ADO.NET using C#. It is a Console application showing you how to loop over the rows in a DataSet and how to check if a Primary Key Exists in a table and finally we will use Find and Delete methods of the DataTable.Rows. DataRow rowFind = ds.Tables[0].Rows.Find(id);