hi everyone,
i want to ask, how can i split cvs file when i import to mssql
my code is here
string csvData = File.ReadAllText(csvPath);
foreach (string row in csvData.Split('\n'))
{
if (!string.IsNullOrEmpty(row))
{
dt.Rows.Add();
int i = 0;
foreach (string cell in row.Split(','))
{
dt.Rows[dt.Rows.Count-1][i] = cell;
i++;
}
}
}
but my cvs file hava a this line
XXX","XXX","04011","XX","XX","XX, YY","N039","S040","A","20141003 18:54","20141003 20:18","20141003 23:18"
when importto red part my code is after , move to another cell

Manas MohapatraPosted Oct 29, 2015, 1:34 AM
Ekrem TapanPosted Oct 29, 2015, 3:06 AM
Ekrem TapanPosted Oct 29, 2015, 3:01 AM
Manas MohapatraPosted Oct 29, 2015, 2:48 AM
Ekrem TapanPosted Oct 29, 2015, 2:32 AM