发布网友 发布时间:2022-04-26 11:18
共1个回答
热心网友 时间:2023-10-09 11:10
设置主键的语句类似以下: Private Sub SetPrimaryKeys() ' Create a new DataTable and set two DataColumn objects as primary keys. Dim myTable As DataTable = new DataTable() Dim keys(2) As DataColumn Dim myColumn As DataColumn ' Create column 1. myColumn = New DataColumn() myColumn.DataType = System.Type.GetType("System.String") myColumn.ColumnName= "FirstName" ' Add the column to the DataTable.Columns collection. myTable.Columns.Add(myColumn) ' Add the column to the array. keys(0) = myColumn