Codigo C#
public static DataSet EmptyDataSet(string[] aColumns) {
Definimos el DataSet que vamos a crearDataSet DSBind = new DataSet();
La tabla, columnas y filas.
DataTable dt = new DataTable();
DataRow dr;
DataColumn dc;
for (int i = 0; i < aColumns.Length; i++) {
dc = new DataColumn(aColumns[i]);
dt.Columns.Add(dc);
}
dr = dt.NewRow();
dr[0] = "";
dt.Rows.Add(dr);
DSBind.Tables.Add(dt);
return (DSBind);
}
Protected function EmptyDataSet(ByVal aColumns() As string) as DataSet
Dim DSBind As New DataSet()
Dim dt As New DataTable()
Dim dc As DataColumn
Dim dr As DataRow
For i As Integer = 0 To aColumns.Length - 1
dc = New DataColumn(aColumns(i))
dt.Columns.Add(dc)
Next
dr = dt.NewRow()
dr(0) = ""
dt.Rows.Add(dr)
DSBind.Tables.Add(dt)
Return (DSBind)
End Sub
Y esto es todo!!
Alex.