/ Published in: VB.NET
Como crear un DataTable a mano y editar sus columnas y filas bajo código.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Private Sub InitDataset() Dim lDataTable As New DataTable Dim lDataColum As DataColumn Dim lDataRow As DataRow lDataColum = New DataColumn lDataColum.DataType = System.Type.GetType("System.String") lDataColum.ColumnName = "FileName" lDataTable.Columns.Add(lDataColum) lDataColum = New DataColumn lDataColum.DataType = System.Type.GetType("System.String") lDataColum.ColumnName = "Extension" lDataTable.Columns.Add(lDataColum) lDataColum = New DataColumn lDataColum.DataType = System.Type.GetType("System.String") lDataColum.ColumnName = "Lenght" lDataTable.Columns.Add(lDataColum) lDataColum = New DataColumn lDataColum.DataType = System.Type.GetType("System.Date") lDataColum.ColumnName = "Date" lDataTable.Columns.Add(lDataColum) mDts = New DataSet mDts.Tables.Add(lDataTable) End Sub