my database table looks like this
i trying to retrieve the FileURL in the CRUD class file like this :
public IList<string> GetSorted(int listAct)
{
IList<Model.story> lstImages = context.stories.ToList();
return lstImages.Where(c => c.ActivityID == listAct)
.Select( a => a.FileURL)
.ToList();
}
Am i doing it right? ( new to this )
Then in my aspx , i try to display the value like this ;
protected void btnSort_Click1(object sender, EventArgs e)
{
if (dropListActivity.SelectedIndex > 0)// drop down list
{
string imgList = daoStory.GetSorted(Convert.ToInt32(dropListActivity.SelectedItem.Value)).ToString();
Response.Write(imgList);
}
}
Basically the drop down list shows activityID 1 or 2 only , and when i select 1 and click the sort button , it will display the FileURL of '1' and if i select 2 , it will display FileURL of '2' so on from the above database table . However , it now shows System.Collections.Generic.List`1[System.String] instead of the FileURL , i want to show the FileURL as stated in the database table , pls help thanks.