vb.net Code:
  1. Dim TaxIDs As New DataTable("TaxIDs")
  2. TaxIDs.Columns.Add("JDX", GetType(Integer))
  3. TaxIDs.Columns.Add("TaxID", GetType(String))
  4. TaxIDs.PrimaryKey = New DataColumn() {TaxIDs.Columns("TaxID")}
Is this the correct way to make my TaxID column the primary key? It seems strange to me because I don't understand. And the MS documentation didn't help me. I'm just not bright enough to understand them.

If so, how does one use the .contains method? I was thinking I have a string value and I would do something like this to avoid duplicates:
vb.net Code:
  1. If Not TaxIDs.PrimaryKey.Contains(strTaxID) Then
  2.     Dim Row As DataRow = TaxIDs.NewRow
  3.     Row("JDX") = JDX
  4.     Row("TaxID") = strTaxID
  5.     TaxIDs.Rows.Add(Row)
  6. End If
But of course that's not right.
Can someone straighten up my code and explain how this works?