نوشته شده توسط
saman-nte
اگه از DataTable برای پر کردن DataGrid استفاده کنیم چی؟!
چطور میشه اینکار رو کرد ؟!
سلام دوست عزیز
از کد زیر استفاده کن:
Private Sub AddAutoIncrementColumn()
Dim column As DataColumn = New DataColumn
column.DataType = System.Type.GetType("System.Int32")
With column
.AutoIncrement = True
.AutoIncrementSeed = 1000
.AutoIncrementStep = 10
End With
' Add the column to a new DataTable.
Dim table As DataTable
table = New DataTable
table.Columns.Add(column)
End Sub
موفق باشید ....