set primary key to datatable c#
  • how to make a column primary key in datatable.
  • 1 Comment sorted by
  • use

      DataColumn[] PK_Column = new DataColumn[1];
            PK_Column[0] = dt.Columns["Column_Name"];

            dt.PrimaryKey = PK_Column;

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook


Popular Posts of the Week