Click here to Skip to main content
15,907,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Using MS Visual Studio2010. server name is correct, only thing is I just can't connect to SQL server but the DB does exist.

Server Error in '/MyShop' Application.

The system cannot find the file specified

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.ComponentModel.Win32Exception: The system cannot find the file specified

Source Error:

Line 18: protected void btnLognn_Click(object sender, EventArgs e)
Line 19: {
Line 20: con.Open();
Line 21: SqlCommand cmd = new SqlCommand();
Line 22: cmd.Connection = con;

Source File: c:\Users\vaio\Desktop\WebdevFinalProject\WebdevFinalProject\MyShop\MyShop\Admin\Login.aspx.cs Line: 20

Stack Trace:

[Win32Exception (0x80004005): The system cannot find the file specified]
MaheshBabuYe 4-Feb-15 1:54am    

Is your database an SQL server or .mdf file ? if it is a local db or .mdf file, check if you have necessary priviliges to access that file location. Also, what is the inner exception you get ? can you debug and check that exactly is the 'file' that cannot be found.
CHill60 4-Feb-15 4:20am    
This does not look to be related to your code.
Are you running this on XP?
If so have you tried to bypass Windows Product Activation?
Are you running any anti-virus software?
ZurdoDev 4-Feb-15 8:06am    
The error is clear. It cannot find the file, whatever file you're trying to access on Line 20. Could be due to permissions or could be the path is wrong.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900