I have an application which takes in a csv file and returns certain rows .
The code that takes the csv and tells which data to send to the db is shown here
List<string[]> Results = sm.parseCSV2(ofd.FileName, de).Where(x=>x.Length >5).ToList();
foreach (string[] item2 in Results)
{
objSqlCommands.sqlCommandInsertorUpdate2("INSERT", Results);//laClient[0]);
}
with my parsing code here
public List<string[]> parseCSV2(string path, char[] delim)
{
// Intialise return value
List<string[]> parsedData = new List<string[]>();
try
{
// With 'StreamRader' read file that is located in save pat
using (StreamReader readFile = new StreamReader(path))
{
string line; // current line
string[] row; // array row
// Go thru file until we reach the end
while ((line = readFile.ReadLine()) != null)
{
row = line.Split(delim);// arry row equals values delimited by pipe
parsedData.Add(row); // add this to return value <List>
}
}
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
return parsedData; // return list
}
alongside my sql code
objConnections.executeSQL(connection,
"INSERT INTO generic.Client(ClientName) VALUES('" + text + "')");
I am then calling the tableadapter
//Refreshs the Client table on display from the
this.clientTableAdapter.Fill(this.CalcDataSet.Client);
//update the view
dgvClientlst.Update() ;
However the data being returned is shown below
System.Collections.Generic.List`1[System.String[]]
I have had it suggested that my query is actually printing the list ToString() but as my code isnt doing that I'm unsure what the problem is . Any help much appreciated