Click here to Skip to main content
12,402,889 members (78,845 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
I have search for solution but still not getting right way for my problem. Bold texts are the error messages.

Can You Please Solve the error:-

Server Error in '/' Application.
--------------------------------------------------------------------------------

Invalid file name.
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.Runtime.InteropServices.COMException: Invalid file name.
Source Error:


Line 17:
Line 18: string FileName = Server.MapPath("Student.rpt");
Line 19: Report.Load(FileName);
Line 20: DataSet ds = new DataSet();
Line 21: ds = (DataSet)Session["StudentDetails"];
Posted 6-Oct-12 2:47am
Comments
Wes Aday 6-Oct-12 9:11am
   
http://www.codeproject.com/Questions/297908/System-Runtime-InteropServices

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Check the path to the file - it is basically saying it doesn't exist. Remember that if you don't specify a path, MapPath returns a path relative to the ASP file being processed.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100