10
Answers

add new cloumn to exsit dataset

Ask a question
MR alaa

MR alaa

8y
433
1
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)