setup primary key for a table visual basic .net 2.0

How can I setup a primary key in the "Serial" column  to do searches with this table I have setup.

  Dim CSVdt1 As DataTable
        'read csv file to create data table for search

        CSVdt1 = New DataTable("CSV_Data")

        CSVdt1.Columns.Add("Name")
        CSVdt1.Columns.Add("Serial")
        CSVdt1.Columns.Add("Description")
        CSVdt1.Columns.Add("Software")
        CSVdt1.Columns.Add("InstallDate")
        CSVdt1.Columns.Add("Notes")
        CSVdt1.Columns.Add("Location")
        CSVdt1.Columns.Add("Perm")
        CSVdt1.Columns.Add("PilotPatch")
        CSVdt1.Columns.Add("SwitchInfo")    'switchinfo
        CSVdt1.Columns.Add("CubeNumer")   'newcube desk location
        CSVdt1.Columns.Add("DeskPortNumber")   'desk port number
        CSVdt1.Columns.Add("AvailableRemote")   'na
        CSVdt1.Columns.Add("CabinetLocation")
        CSVdt1.Columns.Add("misc1")
        CSVdt1.Columns.Add("Misc2")
        CSVdt1.Columns.Add("Misc3")
        Dim sr As System.IO.StreamReader
        Dim strContents() As String = Nothing
        Dim strData() As String = Nothing

        Try
            sr = New System.IO.StreamReader(workstationstext)
            strContents = System.Text.RegularExpressions.Regex.Split(sr.ReadToEnd, "\r\n")
            sr.Close()
        Catch Ex As Exception
            Console.WriteLine(Ex.Message)
        End Try
        For Each strLine As String In strContents
            If strLine.StartsWith(";") Or strLine.Length = 0 Then
                'skipping(line)
            Else
                Try

                    strData = strLine.Split(",")
                    CSVdt1.Rows.Add(strData)
                Catch ex As Exception

                    MessageBox.Show("The csv file contains errors!", "Error Found In csv File" & vbCrLf & strLine, MessageBoxButtons.OK, MessageBoxIcon.Error)

                    Exit Sub
                End Try

            End If
        Next
chadmanvbAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

plusone3055Commented:
http://stackoverflow.com/questions/2470681/how-to-definie-a-vb-net-datatable-column-as-primary-key-after-creation

You can set the primary key of a table by:

    Dim table As New DataTable()      table.Columns.Add(New DataColumn("MyColumn"))      Dim primaryKey(1) As DataColumn     primaryKey(1) = table.Columns("MyColumn")     table.PrimaryKey = primaryKey

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chadmanvbAuthor Commented:
I still could not get this to work.  Could you show me what to change in my code?
chadmanvbAuthor Commented:
Any ideas?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.