Click here to Skip to main content
15,892,480 members
Home / Discussions / C#
   

C#

 
AnswerRe: i need smallest hash string Pin
Anthony Mushrow28-Nov-07 0:08
professionalAnthony Mushrow28-Nov-07 0:08 
GeneralRe: i need smallest hash string Pin
subai28-Nov-07 0:36
subai28-Nov-07 0:36 
Questionhow to find my Queston? Pin
lockepeak27-Nov-07 20:59
lockepeak27-Nov-07 20:59 
AnswerRe: how to find my Queston? Pin
mav.northwind27-Nov-07 21:06
mav.northwind27-Nov-07 21:06 
AnswerRe: how to find my Queston? Pin
m@u27-Nov-07 21:08
m@u27-Nov-07 21:08 
AnswerRe: how to find my Queston? Pin
pmarfleet27-Nov-07 21:36
pmarfleet27-Nov-07 21:36 
QuestionOnline Test using ASP.Net, C# Pin
Satish - Developer27-Nov-07 20:19
Satish - Developer27-Nov-07 20:19 
QuestionHandling Excel files..... Pin
pavya_Cool27-Nov-07 19:46
pavya_Cool27-Nov-07 19:46 
Hi to All,


I am trying to handle excel file in my application. Here I am trying to get a cell value in the text box on the event of button click. but whenever i run it shows exception that Access is denied..... my code is as follows....


private Excel.Application oXL=null;

private void Button1_Click(object sender, System.EventArgs e)
{
InitializeComponent();
oXL = new Excel.ApplicationClass();
oXL.Visible = true;
Excel.Workbook oWB = oXL.Workbooks.Open("D:\\Pravin\\October-07\\xls\\7starcare-October.xls",0,true,5,"","",true,Excel.XlPlatform.xlWindows,"\t",false, false, 0, true);
Excel.Sheets oSheet= oWB.Worksheets;
Excel.Worksheet oWS = (Excel.Worksheet)oSheet.get_Item(1);
TextBox1.Text= Convert.ToString(oWS.Cells.get_Item(1,1));
}

But whenever i run my application it shows exception as follws ....


------------------------------------------------------------------------------------------------
Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

----------------------------------------------------------------------------------------------------


how can i remove this problem?



Pravin

AnswerRe: Handling Excel files..... Pin
pmarfleet27-Nov-07 21:40
pmarfleet27-Nov-07 21:40 
QuestionError: The IListSource does not contain any data sources. Pin
minniemooo27-Nov-07 19:33
minniemooo27-Nov-07 19:33 
QuestionRegarding generic list Pin
ramyanaidu27-Nov-07 19:03
ramyanaidu27-Nov-07 19:03 
Questionconverting an image from ImgPtr to Bitmap Pin
peter_grigg27-Nov-07 19:01
peter_grigg27-Nov-07 19:01 
AnswerRe: converting an image from ImgPtr to Bitmap Pin
Christian Graus27-Nov-07 19:11
protectorChristian Graus27-Nov-07 19:11 
GeneralRe: converting an image from ImgPtr to Bitmap Pin
peter_grigg27-Nov-07 19:47
peter_grigg27-Nov-07 19:47 
QuestionRe: converting image from ImgPtr to Bitmap Pin
peter_grigg27-Nov-07 19:49
peter_grigg27-Nov-07 19:49 
AnswerRe: converting an image from ImgPtr to Bitmap Pin
m@u27-Nov-07 21:03
m@u27-Nov-07 21:03 
QuestionRegarding creation of table structure in word from C#.net. Pin
Ron.S27-Nov-07 18:52
Ron.S27-Nov-07 18:52 
AnswerRe: Regarding creation of table structure in word from C#.net. Pin
Paul Conrad27-Nov-07 18:55
professionalPaul Conrad27-Nov-07 18:55 
GeneralRe: Regarding creation of table structure in word from C#.net. Pin
Ron.S27-Nov-07 18:59
Ron.S27-Nov-07 18:59 
QuestionEncrypting Problem Pin
kingletas27-Nov-07 17:43
kingletas27-Nov-07 17:43 
AnswerRe: Encrypting Problem Pin
Paul Conrad28-Nov-07 14:37
professionalPaul Conrad28-Nov-07 14:37 
QuestionHow to refresh child picturebox when moving (with mouse) on parent picturebox. Pin
Chintan.Desai27-Nov-07 17:39
Chintan.Desai27-Nov-07 17:39 
AnswerRe: Problem with "A low-level audio player in C#" Pin
Christian Graus27-Nov-07 19:14
protectorChristian Graus27-Nov-07 19:14 
QuestionTextbox and Integer Pin
MasterSharp27-Nov-07 15:34
MasterSharp27-Nov-07 15:34 
AnswerRe: Textbox and Integer Pin
Luc Pattyn27-Nov-07 15:50
sitebuilderLuc Pattyn27-Nov-07 15:50 

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.