locked
ADO.NET DataColumn.Unique property and UniqueConstraint class RRS feed

  • Question

  • User1904516115 posted

    Does DataColumn.Unique property and UniqueConstraint class serve the same purpose? Any difference?

    Sunday, August 12, 2018 6:58 PM

All replies

  • User409696431 posted

    They are not quite the same.

    DataColumn.Unique is a true/false field to say if the values in that column must be unique.

    Since DataColumn.Unique could be false, it does not imply UniqueConstraint for that column.

    However, if DataColumn.Unique is true, it should be the same as applying UniqueConstraint to that column.

    Sunday, August 12, 2018 10:43 PM