Loading a datatable into a xml and xml back into a datatable
问题 So I have a I query data into a DataTable using (SqlDataAdapter adapter = new SqlDataAdapter(cmd)) { DataSet dataSet = new DataSet(); adapter.Fill(dataSet, "AccessRights"); return dataSet.Tables[0]; } Now I start to construct the XML to send back to the client string tableData = null; using(StringWriter sw = new StringWriter()) { rightsTable.WriteXml(sw); tableData = sw.ToString(); } StringBuilder build = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(build, new