Click here to Skip to main content
11,482,402 members (71,712 online)
   

ASP.NET

 
QuestionWeb Application Pin
jojoba201128-Nov-12 21:39
memberjojoba201128-Nov-12 21:39 
Questioniss problem in windoms xp Pin
ramukdin28-Nov-12 21:11
memberramukdin28-Nov-12 21:11 
SuggestionRe: iss problem in windoms xp Pin
Richard MacCutchan29-Nov-12 0:36
mvpRichard MacCutchan29-Nov-12 0:36 
Questioncontrols in ASP.Net Pin
vani1028-Nov-12 9:28
membervani1028-Nov-12 9:28 
AnswerRe: controls in ASP.Net Pin
jkirkerx28-Nov-12 13:11
memberjkirkerx28-Nov-12 13:11 
AnswerRe: controls in ASP.Net Pin
mark merrens28-Nov-12 13:21
membermark merrens28-Nov-12 13:21 
AnswerRe: controls in ASP.Net [modified] Pin
CommDev8-Dec-12 23:32
memberCommDev8-Dec-12 23:32 
QuestionMicrosoft Office Excel cannot access the file Pin
umamahesh202028-Nov-12 0:52
memberumamahesh202028-Nov-12 0:52 
I am getting this while import and exporting data to Excel file

Quote:
Microsoft Office Excel cannot access the file 'C:\usr\SVN\ePROM\EffOnePMA\Files\QuestionStructure.xls'.

There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.

Here I am Attacheing my code
private void DownLoadStrcture()
        {
            Excel.Application xlApp;
            Excel.Workbook xlWorkBook;
            Excel.Workbook xlTempWorkBook;
            Excel.Worksheet xlWorkSheet;
            Excel.Range range;
            range = null;
            int rCnt = 2;
            int cCnt = 2;
            string str;
            string fname = "QuestionStructure.xls";
            string Filepath = Server.MapPath("~/Files/" + fname);
            string TempFilename = "QuestionStructure_ " + Convert.ToInt32(Session[PageBase.SESSION_USER_ID]) + ".xls";
            string TempFilepath = Server.MapPath("~/Files/Temp/" + TempFilename);
            string dep = ddlDepartment.SelectedItem.Text.ToString();
            string area = ddlArea.SelectedItem.Text.ToString();
            string category = ddlCategory.SelectedValue != "-1" ? ddlCategory.SelectedItem.Text : "";
            string subCategory = ddlSubCategory.SelectedValue != "-1" ? ddlSubCategory.SelectedItem.Text : "";
 
            xlApp = new Excel.Application();
            xlWorkBook = xlApp.Workbooks.Open(Filepath, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
            xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
            range = xlWorkSheet.UsedRange;
            File.Copy(Filepath, TempFilepath);
 
            xlWorkBook.Close();
            xlApp.Quit();
            releaseObject(xlWorkSheet);
            releaseObject(xlWorkBook);
            releaseObject(xlApp);
 
            xlApp = new Excel.Application();
            xlTempWorkBook = xlApp.Workbooks.Open(TempFilepath, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
            xlWorkSheet = (Excel.Worksheet)xlTempWorkBook.Worksheets.get_Item(1);
            range = xlWorkSheet.UsedRange;
 
            str = (string)(range.Cells[rCnt, cCnt] as Excel.Range).Value2;
            string[] stringArray = new string[] { dep, area, category, subCategory };
            for (int i = 0; i < stringArray.Length; i++)
            {
                (range.Cells[rCnt, cCnt] as Excel.Range).Value2 = stringArray[i].ToString();
                str = (string)(range.Cells[rCnt, cCnt] as Excel.Range).Value2;
                rCnt++;
            }
            xlApp.DisplayAlerts = false;
            xlApp.ScreenUpdating = false;
            xlApp.Visible = false;
            xlApp.UserControl = false;
            xlApp.Interactive = false;
            string Deletefilepath = Server.MapPath("~/Files/Temp/");
            if (File.Exists(Deletefilepath + TempFilename))
                File.Delete(Deletefilepath + TempFilename);
 
            xlTempWorkBook.Close(SaveChanges: true);
            Marshal.ReleaseComObject(xlTempWorkBook);
            xlApp.Quit();
            GC.Collect();
            GC.WaitForPendingFinalizers();
            Marshal.FinalReleaseComObject(xlTempWorkBook);
            Marshal.FinalReleaseComObject(range);
            Marshal.FinalReleaseComObject(xlApp);
            
        }

QuestionhttpModule Type Language Module will not load in Visual Studio debugger Pin
Raimundo2a27-Nov-12 23:50
memberRaimundo2a27-Nov-12 23:50 
AnswerRe: httpModule Type Language Module will not load in Visual Studio debugger Pin
Richard MacCutchan28-Nov-12 1:10
mvpRichard MacCutchan28-Nov-12 1:10 
GeneralRe: httpModule Type Language Module will not load in Visual Studio debugger Pin
Raimundo2a28-Nov-12 5:16
memberRaimundo2a28-Nov-12 5:16 
QuestionException: System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8) Pin
indian14327-Nov-12 14:35
memberindian14327-Nov-12 14:35 
AnswerRe: Exception: System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8) Pin
jkirkerx28-Nov-12 17:55
memberjkirkerx28-Nov-12 17:55 
GeneralRe: Exception: System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8) Pin
indian14329-Nov-12 8:46
memberindian14329-Nov-12 8:46 
GeneralRe: Exception: System.ServiceModel.ProtocolException: The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8) Pin
jkirkerx29-Nov-12 11:02
memberjkirkerx29-Nov-12 11:02 
Questionduplicate insert for no reason! Pin
Jassim Rahma27-Nov-12 11:29
memberJassim Rahma27-Nov-12 11:29 
QuestionError: Could not load file or assembly 'log4net, Version=1.2.10.0 Pin
Super_Developer26-Nov-12 20:41
memberSuper_Developer26-Nov-12 20:41 
QuestionCould not load file or assembly 'log4net, Version=1.2.10.0 Pin
Super_Developer26-Nov-12 20:38
memberSuper_Developer26-Nov-12 20:38 
AnswerRe: Could not load file or assembly 'log4net, Version=1.2.10.0 Pin
Ali Al Omairi(Abu AlHassan)26-Nov-12 21:58
memberAli Al Omairi(Abu AlHassan)26-Nov-12 21:58 
GeneralRe: Could not load file or assembly 'log4net, Version=1.2.10.0 Pin
Super_Developer27-Nov-12 0:38
memberSuper_Developer27-Nov-12 0:38 
GeneralRe: Could not load file or assembly 'log4net, Version=1.2.10.0 Pin
Ali Al Omairi(Abu AlHassan)27-Nov-12 0:54
memberAli Al Omairi(Abu AlHassan)27-Nov-12 0:54 
GeneralRe: Could not load file or assembly 'log4net, Version=1.2.10.0 Pin
Super_Developer27-Nov-12 1:31
memberSuper_Developer27-Nov-12 1:31 
QuestionASP.NET usefull controls Pin
Yoyosch26-Nov-12 20:10
memberYoyosch26-Nov-12 20:10 
AnswerRe: ASP.NET usefull controls Pin
batterybuying27-Nov-12 3:38
memberbatterybuying27-Nov-12 3:38 
GeneralRe: ASP.NET usefull controls Pin
gilvani29-Nov-12 5:37
membergilvani29-Nov-12 5:37 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 23 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid