Suppose i want to get the output as comma seprated string from my list here is the code of it.
private string GetStringFromListItem()
{
List<string> alist = new List<string>();
alist.Add("One");
alist.Add("Two");
alist.Add("Three");
var rtnVal = from x in alist select x;
return string.Join(",", rtnVal.ToArray());
}
You can use this code for LinqToSql also. Very handy code for data conversion and migration projects.