Hello C# code experts,
I am building a C# program which requires that I parse a CSV formatted database, store the data into a two dimension array whose elements I could access and do data manipulations on.
The problem is how do I store them and how do I access them without using a standard database software like Access, Oracle or SQL Server to do data manipulations?Below is my attempt at this. What am I doing wrong? Also I want to produce an output csv file. How would I do it?
{
//Create an Arraylist
System.Collections.ArrayList myArraylist =
DataSet myDataSet =
DataTable GNGTable2 =
myDataSet.Tables.Add("GNGTable2");
DataColumn aColumn;
aColumn =
myDataSet.Tables["GNGTable2"].Columns.Add(aColumn);
}
System.IO.StreamReader myReader =
myString = myReader.ReadLine();
fields = myString();
strFirstName = fields[1];
strLastName = fields[2];
strAddress = fields[3];
strCity = fields[4];
strState = fields[5];
strZip = fields[6];
myDataSet.Tables["GNGTable2"].Rows.Add(myString.Split(
dataGrid1.DataSource = myDataSet(strFirstName,strLastName,strAddress,strCity,strState,strZip);