Good morning, hopefully they can support me I do not want to use bulkcopy or insert Int because when a field is empty in the file shows me an error. Not that I would recommend alternate method.
Thank You,
private DataTable CrearTabla_personal(String fila)
{
int cantidadColumnas;
DataTable tabla = new DataTable("Datos");
String[] valores = fila.Split(new char[] { '|' });
cantidadColumnas = valores.Length;
int idx = 0;
foreach (String val in valores)
{
String nombreColumna = String.Format("{0}", idx++);
tabla.Columns.Add(nombreColumna, Type.GetType("System.String"));
}
return tabla;
}