MR alaa

MR alaa

  • 1k
  • 631
  • 20.6k

add new cloumn to exsit dataset

Apr 3 2016 5:47 AM
hi every body 
i have folder in my website where i can loop in it and get all files ordered i need to add anew column to an exist  data set  this my code 
 
string sourceDir = Server.MapPath("~/folder1/folder2/");
string[] fileEntries = Directory.GetFiles(sourceDir).OrderBy(filename => filename).ToArray();
foreach (string fileName in fileEntries)
{
string x = "<img src=\"" + Path.GetFileName(fileName) + "\" /><br />";
}
 
 this data set already have data i need to add anew colum to the same dataset with the image path from previous code
if (ds.Tables.Count > 0)
{
       // do something 
}
 
how it can be done
 

Answers (10)