 |
| Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Visual Web Developer 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 2nd, 2010, 04:41 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
Invalid value for key 'attachdbfilename'
Hi,
I am using asp.net 2.0, SQL 2005 Express Edition.
I have created one database, thats working fine on local host.
But when I transfered files to my hosting server, Then its giving me Error:-
Invalid value for key 'attachdbfilename'.
My connection string is as follows:-
data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|Data TestingServer.mdf;Database=DataTestingServer;User Instance=true
Please Help me.
Anup
|
|

January 2nd, 2010, 12:34 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
|
|
Quote:
Originally Posted by anup.maverick
But when I transfered files to my hosting server, Then its giving me Error:-
Invalid value for key 'attachdbfilename'.
My connection string is as follows:-
data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|Data TestingServer.mdf;Database=DataTestingServer;User Instance=true
|
The error would indicate that it's having trouble with the database. Can you confirm that the DataTestingServer.mdf file is in the correct location on your hosting server. That's the only thing that comes to mind, since your code says...
Code:
AttachDBFilename=|DataDirectory|DataTestingServer.mdf;
then I believe the database should be in the App_Data folder.
__________________
-------------------------
Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe
When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper
Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
|
|

January 4th, 2010, 01:20 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by chroniclemaster1
The error would indicate that it's having trouble with the database. Can you confirm that the DataTestingServer.mdf file is in the correct location on your hosting server. That's the only thing that comes to mind, since your code says...
Code:
AttachDBFilename=|DataDirectory|DataTestingServer.mdf;
then I believe the database should be in the App_Data folder.
|
Yes , I have kept my database in App_Data Folder,
And when I remove AttachDBFilename property & replace it with Initial Catalog="MYDatabaseName", then it gives me another Error as follows :-
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Thanx
Anup
|
|

January 4th, 2010, 03:25 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
|
|
If it's a connection string issue, I sure don't see it.
The only other idea I can think of is contacting your web host to make sure they've turned on your access to SQL Server. I got similar error messages when I tried it on my account which turned out not to support SQL Server. Even if your account does, it may be something that your host has to activate before it will work. But that's the only other thing I can think of.
__________________
-------------------------
Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe
When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper
Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
|
|
The Following User Says Thank You to chroniclemaster1 For This Useful Post:
|
|
|

January 4th, 2010, 03:46 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Take a look at this:
AttachDBFilename=|DataDirectory|Data TestingServer.mdf;Database=DataTestingServer
You're specifying AttachDBFilename *and* a Database name. Try limiting it to:
AttachDBFilename=|DataDirectory|Data TestingServer.mdf;
only....
Imar
|
|

January 4th, 2010, 04:09 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Imar
Take a look at this:
AttachDBFilename=|DataDirectory|Data TestingServer.mdf;Database=DataTestingServer
You're specifying AttachDBFilename *and* a Database name. Try limiting it to:
AttachDBFilename=|DataDirectory|Data TestingServer.mdf;
only....
Imar
|
I done this, Its not working..!!
Its giving me Error as Follows
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
How can I solve this Error.??
Thanx
Anup
|
|

January 4th, 2010, 04:29 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
That sounds like a) you don't have a local SQL Server called SqlExpress or b) it's not configured to allow connections.
Can you confirm you have SQL Server installed (look under Services in Administrative Tools and search for an instance called SQLExpress).
Cheers,
Imar
|
|

January 4th, 2010, 04:34 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Imar
That sounds like a) you don't have a local SQL Server called SqlExpress or b) it's not configured to allow connections.
Can you confirm you have SQL Server installed (look under Services in Administrative Tools and search for an instance called SQLExpress).
Cheers,
Imar
|
On My Local System, Its working all fine(There is no Error locally).
But when i copied my files to Hosting server, there the Error comes.
What's the solution?
Thanx
Anup
|
|

January 4th, 2010, 04:47 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
In that case, look at what chroniclemaster1 said:
Quote:
|
it may be something that your host has to activate before it will work.
|
You'll need to talk to your host and ask them what kind of connection string you need to use. Typically, hosts don't use SQL Express and require you to connect to another instance of SQL Server.
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|

January 4th, 2010, 05:05 AM
|
|
Authorized User
|
|
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
I will do so..
Thanx for all ur help.
-Anup
|
|
 |