Click here to Skip to main content
15,900,511 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: c# with Linq help getting box checked in database Pin
Brian W King13-May-09 9:33
Brian W King13-May-09 9:33 
GeneralRe: c# with Linq help getting box checked in database Pin
Franklinlloyd13-May-09 9:51
Franklinlloyd13-May-09 9:51 
QuestionAccess server side data from client side Pin
dptalt13-May-09 5:19
dptalt13-May-09 5:19 
AnswerRe: Access server side data from client side Pin
AlexeiXX313-May-09 5:42
AlexeiXX313-May-09 5:42 
GeneralRe: Access server side data from client side Pin
dptalt13-May-09 7:23
dptalt13-May-09 7:23 
GeneralRe: Access server side data from client side Pin
dptalt14-May-09 3:44
dptalt14-May-09 3:44 
QuestionProblem with Compiling a WEb Setup Project Pin
Vimalsoft(Pty) Ltd13-May-09 5:10
professionalVimalsoft(Pty) Ltd13-May-09 5:10 
QuestionExcel Error System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC PinPopular
DotNetCoderJunior13-May-09 4:48
DotNetCoderJunior13-May-09 4:48 
Hi
please please please help!
i'm writing a asp.net app that imports data from an excel spreadsheet into a sql database, i slect a excel file and iterate through each row extracting the data, it works fine from my code and on the server but when i try doing the import from any other machine i get the following error:

System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC


my code is as follows

if (filMyFile.PostedFile != null)
        {
            // Get a reference to PostedFile object
            HttpPostedFile myFile = filMyFile.PostedFile;

            // Get size of uploaded file
            int nFileLen = myFile.ContentLength;

            // make sure the size of the file is > 0
            if (nFileLen > 0)
            {
                // Allocate a buffer for reading of the file
                byte[] myData = new byte[nFileLen];

                string strff = Path.GetFileName(myFile.FileName);
                //WriteToFile((Server.MapPath(strff)), ref myData);
                // initialize the Excel Application class
                
                ApplicationClass app = new ApplicationClass();
                Workbook workBook = app.Workbooks.Open(strff,
                                                     0,
                                                     true,
                                                     5,
                                                     "",
                                                     "",
                                                     true,
                                                     XlPlatform.xlWindows,
                                                     "\t",
                                                     false,
                                                     false,
                                                     0,
                                                     true,
                                                     1,
                                                     0);
                // get the active worksheet using sheet name or active sheet
                Worksheet workSheet = (Worksheet)workBook.ActiveSheet;
                int index = 0;
                // This row,column index should be changed as per your need.
                // i.e. which cell in the excel you are interesting to read.
                object rowIndex = 2;
                object colIndex1 = 1;
                object colIndex2 = 2;
                object colIndex3 = 3;
                object colIndex4 = 4;
                object colIndex5 = 5;
                object colIndex6 = 6;
                object colIndex7 = 7;
                object colIndex8 = 8;
                object colIndex9 = 9;


                try
                {
                    while (((Range)workSheet.Cells[rowIndex, colIndex1]).Value2.ToString()!= string.Empty)
                    {
                        string OrderNumber = ((Range)workSheet.Cells[rowIndex, colIndex1]).Value2.ToString();
                        string FullName = ((Range)workSheet.Cells[rowIndex, colIndex2]).Value2.ToString();
                        string[] arrayFullName = FullName.Split(' ');
                        string FirstName = arrayFullName[0].ToString();
                        string Surname = arrayFullName[1].ToString();
                        string CustomerID = ((Range)workSheet.Cells[rowIndex, colIndex3]).Value2.ToString();
                        string VoucherNumber = ((Range)workSheet.Cells[rowIndex, colIndex4]).Value2.ToString();
                        string Address = ((Range)workSheet.Cells[rowIndex, colIndex5]).Value2.ToString();
                        string CustomerCellNumber = ((Range)workSheet.Cells[rowIndex, colIndex6]).Value2.ToString();
                        string CustomerTellNumber = ((Range)workSheet.Cells[rowIndex, colIndex7]).Value2.ToString();
                        string ConsignmentNumber = ((Range)workSheet.Cells[rowIndex, colIndex8]).Value2.ToString();
                        string HardwareDesc = ((Range)workSheet.Cells[rowIndex, colIndex9]).Value2.ToString();


thank you in advance..
AnswerRe: Excel Error System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC Pin
MidwestLimey13-May-09 5:38
professionalMidwestLimey13-May-09 5:38 
GeneralRe: Excel Error System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC Pin
DotNetCoderJunior13-May-09 20:07
DotNetCoderJunior13-May-09 20:07 
AnswerRe: Excel Error System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC Pin
moslem52228-Dec-10 19:35
moslem52228-Dec-10 19:35 
AnswerRe: Excel Error System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC Pin
Ramesh Swaminathan13-May-09 7:06
Ramesh Swaminathan13-May-09 7:06 
GeneralRe: Excel Error System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC Pin
DotNetCoderJunior13-May-09 20:29
DotNetCoderJunior13-May-09 20:29 
AnswerRe: Excel Error System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC Pin
sarang.c++28-Dec-11 19:39
sarang.c++28-Dec-11 19:39 
QuestionLoading Control along with Javascript on ajax Call Pin
Rizwan Bashir13-May-09 3:09
Rizwan Bashir13-May-09 3:09 
Questionworking with iis 7.0 Pin
aamirzada13-May-09 2:07
aamirzada13-May-09 2:07 
AnswerRe: working with iis 7.0 Pin
Abhijit Jana13-May-09 3:39
professionalAbhijit Jana13-May-09 3:39 
QuestionNeed help regarding Trust Level Error Pin
rockinkash13-May-09 1:56
rockinkash13-May-09 1:56 
AnswerRe: Need help regarding Trust Level Error Pin
logicaldna15-Jun-09 20:24
logicaldna15-Jun-09 20:24 
QuestionConfigure IIS in Windows server 2003 for ASP.NET2.0? Pin
Subin Alex13-May-09 1:42
Subin Alex13-May-09 1:42 
AnswerRe: Configure IIS in Windows server 2003 for ASP.NET2.0? Pin
saanj13-May-09 2:15
saanj13-May-09 2:15 
AnswerRe: Configure IIS in Windows server 2003 for ASP.NET2.0? Pin
Brian W King13-May-09 2:18
Brian W King13-May-09 2:18 
AnswerRe: Configure IIS in Windows server 2003 for ASP.NET2.0? Pin
Abhijit Jana13-May-09 3:45
professionalAbhijit Jana13-May-09 3:45 
QuestionVisual studio problem Pin
gottimukkala13-May-09 1:20
gottimukkala13-May-09 1:20 
AnswerRe: Visual studio problem Pin
Abhijit Jana13-May-09 1:39
professionalAbhijit Jana13-May-09 1:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.