Spliting CSV in a Table Cell(Row) Value

May 3 2011 12:47 PM
Hi Guys,
I have some problems in spiting a composite cell value and adding them into a list box.Can you please let me know how i can do it?

I have a code like below which is suppose to return a Primary Key cell value.the code works fine and return every single cell value for primary key but in some cases which the cell value is a composite value like[UnitCode,ID,Area] the value will add to list box just as ONE Item like UnitCode,ID,Area.


using (OracleConnection oraConnection = new OracleConnection())
  {
  oraConnection.ConnectionString = GenerateConnectionString();
  oraConnection.Open();
  OracleCommand oc = new OracleCommand(cmdPK, oraConnection);
  OracleDataReader reader = oc.ExecuteReader();
  try
  {
  while (reader.Read())
  {
  lstPK.Items.Add(reader[0]);
  }
  }
  catch (Exception ex)
  {
  lblCon.Text = ex.Message;
  }



Can you please let me know how I can split the value in a cell and add them to a list box like three separate items?
Thanks for you time

Answers (1)