ice7

[FIX] No unique Values Datatable

Sep 16th, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.38 KB | None | 0 0
  1.                 Dim index As Integer = 0
  2.                 Dim lDColumn As New DataColumn("RowId", Type.GetType("System.Int32"))
  3.                 lDt.Columns.Add(lDColumn)
  4.                 For Each dRow In lDt.Rows
  5.                     index = index + 1
  6.                     dRow("RowId") = index
  7.  
  8.                 Next
  9.                 lDt.PrimaryKey = New DataColumn() {lDt.Columns("RowId")}
Advertisement
Add Comment
Please, Sign In to add comment