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 2: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 OriginalGriff 433
1 Sergey Alexandrovich Kryukov 187
2 PhilLenoir 120
3 Richard Deeming 120
4 RyanDev 115
0 Sergey Alexandrovich Kryukov 6,405
1 OriginalGriff 5,798
2 CPallini 2,473
3 Richard MacCutchan 1,647
4 Abhinav S 1,530

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