Quantcast
Channel: Excel Data Reader - Read Excel files in .NET
Viewing all articles
Browse latest Browse all 448

New Post: Reading excel sheet without saving

$
0
0
Hi Team,
      I want user to give option to browse and upload excel sheet and then load worksheet data into sql server table.
     Dev Server its fine, But in Prod.Server I don't have write access on any directory. So, I have to read it directly from the memory stream without saving it. Following code am executing with the help of ExcelData Reader dll, could you please suggest if am on the right track to avoid any write permission issue on web server?

    if (FileUploadControl.HasFile)
        {
            try
            {
                string fileExt = System.IO.Path.GetExtension(FileUploadControl.FileName);

                if (fileExt == ".xls")
                 {
                   Stream myStream = FileUploadControl.PostedFile.InputStream;

                    IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(myStream);

                    excelReader.IsFirstRowAsColumnNames = true;

                    DataSet ds1 = excelReader.AsDataSet();

                     excelReader.Close();
                   }

Viewing all articles
Browse latest Browse all 448

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>