.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cannot connect to \SQLEXPRESS.

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
Hi all. I have use vs.net 2008 and sql erver 2008. When I wanna connect to sqlExpress in Sql Server Managment Studio 2008 this error is shown:   Cannot connect to SAEID-PC\SQLEXPRESS.A network-related or instance-specificerror occurred while establishing a connectionto SQL Server. The server was not found or was notaccessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error LocatingServer/Instance Specified) (.Net SqlClient Data Provider) In SqlServer Configuration Manager when I want start SqlExpress service an error is shown to me that cann't start the service. " Sorry for my english !!"

View Complete Post

More Related Resource Links

Cannot connect to \SQLEXPRESS.

Hi all. I have use vs.net 2008 and sql erver 2008. When I wanna connect to sqlExpress in Sql Server Managment Studio 2008 this error is shown:   Cannot connect to SAEID-PC\SQLEXPRESS. 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) (.Net SqlClient Data Provider) In SqlServer Configuration Manager when I want start SqlExpress service an error is shown to me that cann't start the service. " Sorry for my english !!"    

Can't connect to SQLEXPRESS on another machine on LAN


This is a Workgroup environment; i.e., no Domain, no DC. I'm attempting to connect to MACHINEB\SQLEXPRESS from SSMS 2008 using Windows Authentication. SSMS is running on MACHINEA -- so the default (and I can't change it) username is MACHINEA\mylogon. There is a similar account on MACHINEB; i.e., username is <mylogon> and password is the same as on MACHINEA. This works fine for browsing files, etc.; however apparently it does NOT work for SQLEXPRESS access.

The error I get is the "Server not found or was not accessible..." message. My guess is that this is a security issue and that maybe I need to use SQL Server Authentication, but I'd prefer not to do that if I can avoid it. So, is there a way to access SQL across a LAN using Windows Authentication?


Bill Cohagan

SQL Authentication within SQLExpress Not Able to Connect to SQL User from Visual Studio?


I detached a database from sql server 2005 to an mdf file. I am able to logon to this mdf file from server management studio within sqlexpress instance using the sql user/pwd with no problem.

Within Visual Studio however, if I try to connect useing  the Server Explorer, I receive the error:
"Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed."

I went into Advanced Properties and changed User Instance to False, and then get this error:
"Create Database Permission denied in database "master". An attempt to attach an auto-named database for file "c:\......mdf" failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

I opened the database again in management studio and detached it from sqlexpress, but still get same errors.

This issue is similar to the one posted here

but unfortunately for me, none of the suggestions in that po

Error 26 while trying to Connect to a SQLExpress 2005 database on a remote computer


I have installed SQL Express 2005 on two computers networked and running windows XP.  I've copied the database from the first computer to the second and run queries on both to show that both computers have an active database that is up and running.  Now I am trying to use the Sql Server Management Studio Express (SSMSE) on the first machine to establish contact with the second machine.  In order to have the two machines communicate I've configured the SQL Server on the second machine as follows:

Under the protocols for the SQL Server 2005 Network Configuration I've enabled the TCP/IP pipes and set the TCP/Dynamic ports to 1032 (when I ran netstat -a it indicated that this was an active connection which I think this means it is available - though it says that the port has a Foreign Address and it State is listening).  As an aside the port 1433 was not among the active connections.

Both the SQLServer and the SQLServer browser are running (which presumably means they are both enabled).

I've run the surface Area Configuration For Services and Connections Tool to Set the SQLExpress Remote connections for Local and remote connections using TCP/IP and named pipes.

The Client Protocols for the SQL Native Client Configuration is stillset so that the default port is 1433. 

When I look at the most recent

InfoPath 2010 cannot connect to SharePoint 2010

You have installed Office 2010 beta and you are trying to connect to SharePoint 2010 from InfoPath but you get an error

could somebody give me example how I can connect to database only once if I use many models in contr


I use in my ASP.NET MVC application repository pattern and I use in controller for example 3 models:

   namespace MvcApplication1.Controllers  
        public class HomepageController : Controller  
            private IWebsitesRepository _repository_websites = new WebsitesRepository();  
            private IFirmRepository _repository_firm = new FirmRepository();  
            private IPhotosRepository _repository_photos = new PhotosRepository();  

In WebsiteRepozitory, FirmRepository and PhotosRepository classes I have:

Database1Entities _entities = new Database1Entities();

So I have 3 connections to database ? Is it wrong ? How can I solve it ?

SAAS: Connect Enterprise Apps with Hosted BizTalk Services


In this article we introduce you to BizTalk Services, new technology that offers the Enterprise Service Bus features of BizTalk Server as a hosted service.

Jon Flanders and Aaron Skonnard

MSDN Magazine June 2008

Interop: Connect To Mainframe Apps With BizTalk Adapters and .NET


If you have a significant investment in legacy COBOL applications running on mainframes, you need the BizTalk Adapters for Host Integration Server .

Bashar "Bash" Badawi

MSDN Magazine December 2007

Help with connecting to SqlExpress 2005 remotely


So I've intalled SQL 2005 Express and Sql Server Management Studio Express (SSMSE). I don't have any problems connecting to it using Windows authentication. But I would like to set it up so that I can log in using Sql Server Authentication with a username and password.

My Problem

But I'm getting an error message of "A connection was successfully established with the server, but then an error occured during the login process. (provider: Shared Memory Provider, error: 0- No process is on the other end of the pipe) (Microsoft SQL Server, Error: 233).

What I've done

I've created a new "Login" in the Security node. Provided all necessary role access level. Granted permission to connect to database and enabled login.

I've used the Sql Server Surface Area Configuration to set the Remote Connection type to "Using TCP/IP only" or "Using Both TCP/IP and named pipes" (tried both, but in either situation I get the same error message when attempting to login to SSMSE with the user name and password). I also made sure to restart the service.

What do I need to do to fix this problem? 

ASP.Net connect to Oracle.


 We have an application which uses  'System.Data.OracleClient'. On the box it was developed we can change the TNSNAMES.ORA entries to connect to different oracle databases. Moving the code to a  Microsoft Server 2008 box it would appear that the application ignores the TNSNAMES.ORA file. It has cached the first Oracle connection and will now work without any TNSNAMES.ORA file. Where is it getting the connection? We have set tns_admin to point at the TNSNAMES.ORA file. We can tnsping the connection OK.

Facebook Connect


Does anybody have links to relevant articles on how Facebook Connect integrates with the Membership provider?

I'd like to make a .net site where you can login through the membership provider, or the Facebook Connect system.  But the big question is, how does your asp.net application know when the Facebook authentication has been successful.  Without manually entering a username and password, is there a function to authenticate users and draw the profile info from Facebook's data?

It seems like a good system, but the documentation is sparse.

unable to connect to database



I am using visual studio 2005 and sql server 2005.

I am developing a small quiz application and i have stored the connection string in app.config file which is given below.:

<?xml version="1.0" encoding="utf-8" ?>
        <add name="quizdb"
            connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Quiz Application.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
            providerName="System.Data.SqlClient" />
i have retrieved connection string property through configurationmanager class 

and when i m connecting to database  it gives me a runtime error:


Sql Exception was unhandled

System.Data.SqlClient.SqlException was unhandled
  Message="An attempt to attach an auto-named database for file F:\\Quiz\\Quiz\\bin\\Debug\\Quiz Application.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located

Connect to existing sql 2005 database


Hello There,

I had successfully restored sql 2000 database to sql 2005. It works like charm

Now i am creating a database model in MVC

I follow these steps

Right click on model > ADO.NET entity data model > Generate from database > New connection (Microsoft sql server) > server name > select or enter database name

But no server name AND database name show in both drop down lists. When i mannually enter database name (which exists in sql 2005) then click on TEST CONNECTION. It gives follwoing error

"A network-related or instance-specific error 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.

Kindly help me with this


App_Data - development vs production - SQLExpress


Help please, on mdf/ldf files manipulation between dev and prod App_Data folders.

My dev folder: ...\Visual Studio 2010\Projects\WebApplication1\
My prod folder: C:\inetpub\mywebsite\

There are 4 files in [dev]\APP_Data

The VS2010 publishing process copies the 4 files to [prod]\App_Data where my website users interact with them updating data therein.

Next time I publish, the files in [prod]\App_Data get overwritten, losing all current membership and app data changed by my website users.

I tried using SQL Server Management Studio, before publishing, to export current data from [prod]\App_Data\aspnetdb.mdf and myappdb.mdf, and import to [dev]\App_Data\aspnetdb.mdf and myappdb.mdf, but that brought up a bunch of detaching/attaching issues, ending up wiping out all security permissions settings of all the related files, even though I had used SQL Server Configuration Manager to stop the SQLExpress Service beforehand.

IIS Application Pool Identity:

App_Data mdf/ldf files security permission settings:
    SYSTEM: Full Control (dev/prod)
    NETWORK SERVICE: Read/Write (dev/prod)

Basic ODBC Connection to connect to Crystal ???


I have visual studio 2008 professional with the inbuilt crystal reports version 10 I think.  I create everything from my laptop and IIS runs from my laptop as well.

I have created the most basic report to try and figure out a problem I have, anyways the report contains one database field that is it .... which I connect to by ODBC.  I then create a web form add the crystal report viewer to the report and the crystal report source run the web page and it loads the data from the field as I would expect to the crystal report viewer !!

I have several ODBC connections setup on my machine one using integrated security the other using SQL authentication both are system DSNs.  Now when I publish my application and access it from IIS and not the localhost I can access everything from my application ok except when I go to form that has the crystal reports I get this error (ODBC used here is the 'sa' account)

Logon failed. Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Error in File

If I use the other ODBC that uses Windows authentication I get this error message

Logon failed. Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database  requested by the login. T

Enter your credentials to connect to the web service


When trying to publish an InfoPath 2007 form template (as a Content Type), I am getting the following message with a UserName/Password dialog box:
Enter your credentials to connect to the following web service: http://MySitePath/_vti_bin/Webs.asmx

When I enter my credentials, the above dialog box appears again. I have carefully entered my credential. Another thing I noticed that despite this error I see the form got created at the destination library. The only thing is that the Content Type did not get created and hence is not available in the "Site Content Type Gallery".

We are using Sharepoint 2007 enterprise edition. And I have recently published the InfoPath form templates several time as Content type without any issue.


Please help. Thanks........

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend