Skip to content

Instantly share code, notes, and snippets.

@bobthemighty
Created November 13, 2014 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobthemighty/e9c0021c50708a63d604 to your computer and use it in GitHub Desktop.
Save bobthemighty/e9c0021c50708a63d604 to your computer and use it in GitHub Desktop.
using(var cn = new SqlConnection(MA_CONNECSHUNS))
using (var cmd = new SqlCommand(MA_QUERIES, cn))
{
cn.Open();
using (var reader = cmd.ExecuteReader())
while (reader.Read())
{
SqlXml xml = reader.GetSqlXml(1);
using (var xr = xml.CreateReader())
{
var root = XDocument.Load(xr);
var foo = GetDynamic(root);
string json = Newtonsoft.Json.JsonConvert.SerializeObject(foo);
Console.WriteLine(json);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment