Click here to Skip to main content
12,949,601 members (66,782 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
Wes Aday 6-Oct-12 9:11am

1 solution

Rate this: bad
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.

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
OriginalGriff 5,489
CHill60 3,380
Maciej Los 2,913
Jochen Arndt 1,935
ppolymorphe 1,820

Advertise | Privacy | Mobile
Web02 | 2.8.170524.1 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2017
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