StringBuilder stringBuilder = new StringBuilder(string.Empty);
StringWriter stringWriter = new StringWriter(stringBuilder);
DataSet dsMemmoryList = new DataSet();
dsMemmoryList.Tables.Clear();
DataTable dtMemmoryList = new DataTable();
dtMemmoryList.Columns.Add("RowNumber");
dtMemmoryList.Columns.Add("AccessionNo");
DataRow drLoan;
int rowNumber = 1;
foreach (string accession in accessionCollecion)
{
drLoan = dtMemmoryList.NewRow();
drLoan[0] = rowNumber;
drLoan[1] = accession;
dtMemmoryList.Rows.Add(drLoan);
rowNumber++;
}
dsMemmoryList.Tables.Add(dtMemmoryList);
dsMemmoryList.WriteXml(stringWriter, XmlWriteMode.WriteSchema);
string string1 = "\\\"";
string string2 = "\"";
string xml = Convert.ToString(stringBuilder);
xml = xml.Replace(string1, string2);
return xml;