"gregory_may" <None> schrieb
Seems silly I need two lines of code for this. Any way to do it in one?
Dim DcArray() As DataColumn = {MyData.Tables(0).Columns("PhoneNumber")}
MyData.Tables(0).PrimaryKey = DcArray
mydata.Tables(0).PrimaryKey = New DataColumn()
{mydata.Tables(0).Columns("PhoneNumber")}
Two lines only due to word wrapping in the posting. :) Usually I would write
mydata.Tables(0).PrimaryKey = New DataColumn() { _
mydata.Tables(0).Columns("PhoneNumber") _
}
but than you had three lines instead of one.... Therefore I would change it
to
Dim DcArray() As DataColumn = {MyData.Tables(0).Columns("PhoneNumber")}
MyData.Tables(0).PrimaryKey = DcArray
Ooops, that's what you already have.
;-)
Armin