0
votes

As the title of the post describes, I am attempting save a DataTable straight into a SharePoint Document Library.

Here is what I had originally:

                DataTable dt = new DataTable();

                //add rows to datatable
                foreach(GridViewRow row in Gv.Rows)
                {
                    //omitted for the sake of brevity
                }


                dt.WriteXml("TEMP PATH", true);

However, instead of saving it to a temporary location as an xml file, can I do a sort of all in one where I convert the DataTable into an xml format and upload it to the Document Library? Thanks.

1

1 Answers

0
votes

You can save the XML file to a temporary location and then save that file to sharepoint document library. AFter the file is uploaded successfully, you can delete the file.

For uploading file : How to download/upload files from/to SharePoint 2013 using CSOM?

How do you upload a file to a document library in sharepoint?