How to define a VB.NET DataTable Column as primary key after creation

前端 未结 5 635
天命终不由人
天命终不由人 2021-02-08 22:40

I am importing Tables from a Oracle DataBase, using a VB.NET dataAdapter. I use the \"fill\" command to add the imported data to a DataSet. How is it possible to define a specif

5条回答
  •  [愿得一人]
    2021-02-08 22:53

    As long as the values in the column are unique

    table.PrimaryKey = new DataColumn[] { table.Columns["Id"] };
    

    adjust for your column names.

提交回复
热议问题