Converting Data from memory stream to Data table
I am trying to fetch a data from an excel file url on a sharepoint site and put it in a data datatable but getting this error: The input stream is not a valid binary format. The starting contents (in bytes) are: 50-4B................ Here is the code which i am using :- WebClient webClient = new WebClient(); webClient.Credentials = CredentialCache.DefaultNetworkCredentials; byte[] data = webClient.DownloadData("http://sp2010sw127:2000/eur/Home/TestLibrary/Details.xlsx"); MemoryStream memoryStreamOfFile = new MemoryStream(data); BinaryFormatter formatter = new BinaryFormatter(); memoryStreamOfF
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.