Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Can I use Sql Server Database file in VS 2010 with SQL server 2008 r2 Developer Edition instance? Because every time I tried to add a database file to the VS solution to App_Data (which is an ASP.Net) folder it creates an error saying that "A network related error or instance related error occurred while establishing a connection to SQL Server".
 
I have googled with every possible scenarios but unfortunately I cannot find the fault. I even changed the SQL Server 2008 R2 Developers' TCP/IP and other network configuration but no use of them! This is very critical to me!
Posted 26-May-13 2:21am
Comments
Basmeh Awad at 26-May-13 7:54am
   
have you gone through this..
http://www.sswug.org/articlesection/default.aspx?TargetID=44331
RedDK at 27-May-13 15:36pm
   
Is there any chance that this "VS solution" has compiled and been published and is now residing in inetpub on C:\ drive of the development box on which it's running/throwing errors? Because if it is, the directory permissions and/or configuration might not be right.
 
To see if it is resident, check in "Computer Management" and under the "Services and Applications" tab select "Internet Information Services(IIS) Manager". There's even a chance IIS isn't enabled yet on the box which means IISM will be a no show; in which case run "Programs and Features" then "turn on" (Add Feature) in "Features" ... etc

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yes.
 
I do, all the time.
But that probably isn't the problem you are having. I think you are trying to use things wrongly.
 
When you talk about the App_Data folder, you are talking about a website based solution, so the chances are that there are several possible problems, and it is entirely possible that you are meeting them all...
 
The first is that the connection string to SQL server is very, very likely to be completely different for your production and development environments. Normally, the development works on a local (or local-to-the-LAN) instance of SQL server, which is kept separate from the production system. Check that the connection string you are using refers to the production instance, which is likely to require log in rather than the simpler windows authorisation that development normally uses. Also check that the login details are correct for the production server.
 
The second is that in production, the SQL Server and the Web Server are very likely to be separate PC's: so it is very, very unlikely that the SQL server instance can access any files in the web site folder hierarchy - these are not normally shared!
 
The third is that even if they two are on the same machine, the SQL server instance runs under a different user id, which is unlikely to have any permissions to access or create files in the website folder structure.
 

So, start by looking at the obvious, and work your way down: you don't want to store SQL files in a website folder anyway...
  Permalink  
Comments
Chiranthaka Sampath at 27-May-13 0:17am
   
I have done that in SQL Server Express 2008 that comes with VS 2010 and it didn't give the error that previously displayed. Then what is the reason for that pal!

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

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 265
2 CPallini 235
3 Sergey Alexandrovich Kryukov 229
4 Maciej Los 190
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 27 May 2013
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