Solved

Not a valid file name

Posted on 2004-08-20
8
1,924 Views
Last Modified: 2012-05-05
I have tested my ASP.NET application before and worked on my IIS and WebMatrix Application. But Now that I have put it on a web hosting site. I get the following error. I have transferred the required webmatrix dlls. But I keep getting this error.

I think that it has to do something with my web.config file's path attribute which is set to path="/".


I will point anyone who can figure this out or help out...


Thanks in Advance.

Here is the error:






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

Not a valid 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.Data.OleDb.OleDbException: Not a valid file name.

Source Error:


Line 95:                 cmd.Connection = con
Line 96:                 cmd.CommandText = sSQL
Line 97:                 con.Open()
Line 98:                 Try
Line 99:                     cmd.ExecuteNonQuery()
 

Source File: E:\web\hinoecucom0\htdocs\default.aspx    Line: 97

Stack Trace:


[OleDbException (0x80004005): Not a valid file name.]
   System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
   System.Data.OleDb.OleDbConnection.InitializeProvider() +57
   System.Data.OleDb.OleDbConnection.Open() +203
   ASP.default_aspx.Execute(String sSQL) in E:\web\hinoecucom0\htdocs\default.aspx:97
   ASP.default_aspx.Button1_Click(Object sender, EventArgs e) in E:\web\hinoecucom0\htdocs\default.aspx:72
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1277

 

0
Comment
Question by:IZING
8 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 11852950
Sounds like your connectionstring may be pointing to an incorrect location.  What database are you using?  If it is access, you should use Server.MapPath when creating the connectionstring.
0
 
LVL 1

Author Comment

by:IZING
ID: 11853629
I am using Server.MapPath in my code for Access.
0
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 500 total points
ID: 11853803
Just output  server.MapPath to a label or something.. and see what address it gives.   Usually it gives the address where the aspx file is. Make changes accordingly, to get to your database file.
-Baan
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 10

Expert Comment

by:EBatista
ID: 11854470
you have to set up your app in IIS.
go to IIS manager, rightclick your app folder and hit properties, then under the Directory tab, in the Application Settings region hit the Create button.
that should work.

regards
0
 
LVL 10

Expert Comment

by:EBatista
ID: 11854742
IZING, skip my post, i have posted it in the wrong thread.
0
 
LVL 5

Expert Comment

by:rajaamirapu
ID: 11857760
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question