Solved

Not a valid file name

Posted on 2004-08-20
8
1,923 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

3 Use Cases for Connected Systems

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

Question has a verified solution.

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

Suggested Solutions

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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