You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
815 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace Utils.Printers
{
public static class PrintTable
{
public static DataColumn CreateColumn(this DataTable table, string dataType, string columnField, string header, bool isReadOnly, bool isUnique)
{
var column = new DataColumn();
column.AutoIncrement = false;
column.DataType = Type.GetType(dataType);
column.ColumnName = columnField;
column.Caption = header;
column.ReadOnly = isReadOnly;
column.Unique = isUnique;
table.Columns.Add(column);
return column;
}
public static DataColumn CreateColumn(this DataTable table, string dataType, string columnField, string header)
{
return table.CreateColumn(dataType, columnField, header, false, false);
}
}
}