private void button2_Click(object sender, EventArgs e) { conn.Open(); DataTable dt = GetXmlFileDataTable(conn); using(MemoryStream memStream = new MemoryStream((byte[])dt.Rows[0][0])) { memStream.Position = 0; byte[] array = memStream.ToArray(); XDocument objXDoc = new XDocument(); string xml = Encoding.UTF8.GetString(array); XDocument xmlDoc = XDocument.Parse(xml); string fileName = "VarBinary.xml"; string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), fileName); xmlDoc.Save(path); memStream.Dispose(); } //button1.Enabled = true; //button2.Enabled = false; conn.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)