I am trying to insert an inport csv file into my database in my winform program for C #.
for example csv file:
code ,name ,price
101010,computer,200$
and i did this:
char[] BI = { ',' };
string[] WI = TEMP.Split(BI);
A = WI[0].Trim().ToString();
B = WI[1].Trim().ToString();
C = WI[2].Trim().ToString();
but what can I do if the name contains (,)?
eg
code ,name ,price
101010,computer 12,200.00,200$
if I get this type of csv:
code ,name ,price
"101010","computer 12,200.00","200$"
how to handle this?
source
share