Click here to Skip to main content
Rate this: bad
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 3:47am
Wes Aday at 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
0 Sascha Lefévre 490
1 Sergey Alexandrovich Kryukov 413
2 Maciej Los 210
3 Abhinav S 205
4 Richard Deeming 170
0 Sergey Alexandrovich Kryukov 6,928
1 OriginalGriff 6,381
2 Maciej Los 2,782
3 Abhinav S 2,732
4 Peter Leow 2,694

Advertise | Privacy | Mobile
Web04 | 2.8.150414.1 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2015
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