Last post Aug 27, 2009 03:54 AM by anandkbs
Aug 26, 2009 06:36 AM|scotth7a9|LINK
I have installed VS 2008 and am trying to use it to create a web site, no matter what I try I cannot seem to connect to the localhost using Visual Studio.
I thought it might have been an installation problem so I uninstalled everything on my computer dealing with .net framework, visual studio or SQL Server, restarted, installed Visual Studio 08(full version) from scratch let it install all the needed components
and then followed recommendation to update Windows. If I create a site in the IDE and use ctrl f5 to run it I can run it on the development server, it will say localhost:xxxx where xxxx is a port number. However if I try to create a database connection in
the IDE I get an error: named pipe provider, error -40 -could not open a connection to SQL server. I can change the errror slightly by changing the data provider to framework for OLE DB but still cannot connect. Basically I cannot seem to connect to localhost
no matter what I try. I have tried to find help on the error but everything I find seems to be geared towards a remote computer as the server, not a local connection. Never the less I have followed every suggestion I could find.
I have allowed remote connection using both remote pipes and tcp/ip in the server surface area configuration tool.
I have enabled every sub catagory of IIS services on my computer.
I have ensured that I can navigate to localhost in my browser.
Ensured that the SQL server service and the SQL Server Browser services are running.
I get the feeling I am missing something simple in the setup of the DB or VS. Is there somewhere on the web a step by step guide to solving localhost connection problems like this? Or perhaps a step by step guide as to how to set up/install SQL server express
on a home computer when you are using it to develop web sites?
I am using Vista Home premium 32 SP1.
Aug 26, 2009 09:40 AM|oidldb|LINK
I am usig SQL Server express 2005 in one of my websites and here's a short example of how I'm doing it:
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS; AttachDbFilename="+Server.MapPath("~/App_Data/")+"ip-countries.mdf;Integrated Security=True;User Instance=True");
SqlCommand thisCommand = con.CreateCommand();
thisCommand.CommandText = "SELECT country FROM ipcountries WHERE "+ip.ToString()+" BETWEEN s AND e";
result = (string)thisCommand.ExecuteScalar();
Aug 27, 2009 12:51 AM|srikanth2003|LINK
Did you install Visual Studio first and then SQL Express? This could be a problem(I had).
If yes, try using MS uninstall utility to uninstall both, try SQL installation first and then VS.
Aug 27, 2009 03:54 AM|anandkbs|LINK
I think this is not the problem in SQL Server (Database).
Configure a virtual directory for this.