I have a stored procedure which uses a FOR XML statement at the end of it, and returns me some XML.
I am using .NET 4 and the Entity Framework and when I do a functi
I upvoted Fermin's answer. Response to Dementic (and anyone else), here is a code fragment.
From this:
using (var db = new MyEntities())
{
IEnumerable results = db.GetSomeXML(ProductCode);
return results.FirstOrDefault();
}
To this:
using System.Text; //For the StringBuilder
using (var db = new MyEntities())
{
StringBuilder retval = new StringBuilder();
IEnumerable results = db.GetSomeXML(ProductCode);
foreach (var result in results)
retval.Append(result);
return retval.ToString();
}