Re: Unable to Locate Server
- From: "Roger Wolter[MSFT]" <rwolter@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 5 Jan 2006 22:24:47 -0800
This indicates you are running with a User Instance. The aspnetdb.mdf and
ldf files must be in the same directory as your application. ASPNET user
must have permissions to read and write the files. To understand how User
Instance work, you might want to check here:
http://msdn.microsoft.com/sql/express/default.aspx?pull=/library/en-us/dnsse/html/sqlexpuserinst.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"onecorp" <onecorp@xxxxxxxxxxxxxxxx> wrote in message
news:219669F9-34A5-47BA-952F-BA4B40936111@xxxxxxxxxxxxxxxx
>
>
> "onecorp" wrote:
>
>> Yes, I am using the copy of SQL Express that came with Visual Studio.
>>
>>
>> Stack Trace:
>>
>>
>> [SqlException (0x80131904): An error has occurred while establishing a
>> connection to the server. When connecting to SQL Server 2005, this
>> failure
>> may be caused by the fact that under the default settings SQL Server does
>> not
>> allow remote connections. (provider: SQL Network Interfaces, error: 26 -
>> Error Locating Server/Instance Specified)]
>> System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
>> exception, Boolean breakConnection) +734979
>>
>> System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
>> stateObj) +188
>> System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner,
>> Boolean& failoverDemandDone, String host, String failoverPartner, String
>> protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire,
>> Boolean
>> encrypt, Boolean trustServerCert, Boolean integratedSecurity,
>> SqlConnection
>> owningObject, Boolean aliasLookup) +820
>>
>> System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
>> owningObject, SqlConnectionString connectionOptions, String newPassword,
>> Boolean redirectedUserInstance) +628
>>
>> System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
>> identity, SqlConnectionString connectionOptions, Object providerInfo,
>> String
>> newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
>> +170
>>
>> System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
>> options, Object poolGroupProviderInfo, DbConnectionPool pool,
>> DbConnection
>> owningConnection) +359
>>
>> System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
>> owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
>> System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
>> owningObject) +424
>>
>> System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
>> owningObject) +66
>> System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
>> owningObject) +496
>>
>> System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
>> owningConnection) +82
>>
>> System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
>> outerConnection, DbConnectionFactory connectionFactory) +105
>> System.Data.SqlClient.SqlConnection.Open() +111
>> System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
>> DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
>> srcTable,
>> IDbCommand command, CommandBehavior behavior) +121
>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
>> startRecord,
>> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
>> behavior) +137
>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
>> srcTable) +83
>>
>> System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments
>> arguments) +1770
>> System.Web.UI.DataSourceView.Select(DataSourceSelectArguments
>> arguments,
>> DataSourceViewSelectCallback callback) +17
>> System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
>> System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
>> System.Web.UI.WebControls.GridView.DataBind() +4
>> System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
>>
>> System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
>> +69
>> System.Web.UI.Control.EnsureChildControls() +87
>> System.Web.UI.Control.PreRenderRecursiveInternal() +41
>> System.Web.UI.Control.PreRenderRecursiveInternal() +161
>> System.Web.UI.Control.PreRenderRecursiveInternal() +161
>> System.Web.UI.Page.ProcessRequestMain(Boolean
>> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>> +1360
>>
>>
>>
>>
>>
>>
>> "Roger Wolter[MSFT]" wrote:
>>
>> > I'm not an ASP expert but it would appear that your ASP page thinks it
>> > is
>> > trying to make a remote database connection while you think your
>> > database is
>> > local. I would suggest you read up on connection strings and see if
>> > yours
>> > needs to be changed to point to a local database. If you post your
>> > connection string we may be able to determine if there's a problem with
>> > it.
>> > Are you using the copy of SQL Express that came with Visual Studio or
>> > another database?
>> >
>> > --
>> > This posting is provided "AS IS" with no warranties, and confers no
>> > rights.
>> > Use of included script samples are subject to the terms specified at
>> > http://www.microsoft.com/info/cpyright.htm
>> >
>> > "onecorp" <onecorp@xxxxxxxxxxxxxxxx> wrote in message
>> > news:507167C5-5C9D-4C18-8F49-510F66C346A0@xxxxxxxxxxxxxxxx
>> > >I am a beginner to SQL..........I am trying to use the database
>> > >quickstarts
>> > > in the ASP.Net SDK 2.0 but have encountered the error listed below.
>> > > (The
>> > > quickstarts are being accessed off line having down loaded them from
>> > > the
>> > > Visual Studio disc / utilizing Windows XP Professional).
>> > >
>> > >
>> > > The information I have read to date refers to accessing the server
>> > > from a
>> > > remote computer, however, I am trying to access it from a local
>> > > machine
>> > > only.
>> > > Can anyone assist (in plain English for a beginner to understand)
>> > > please ?
>> > >
>> > > Thanking you in anticipation.
>> > >
>> > > An error has occurred while establishing a connection to the server.
>> > > When
>> > > connecting to SQL Server 2005, this failure may be caused by the fact
>> > > that
>> > > under the default settings SQL Server does not allow remote
>> > > connections.
>> > > (provider: SQL Network Interfaces, error: 26 - Error Locating
>> > > Server/Instance
>> > > 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.Data.SqlClient.SqlException: An error has
>> > > occurred
>> > > while establishing a connection to the server. When connecting to
>> > > SQL
>> > > Server
>> > > 2005, this failure may be caused by the fact that under the default
>> > > settings
>> > > SQL Server does not allow remote connections. (provider: SQL Network
>> > > Interfaces, error: 26 - Error Locating Server/Instance Specified
>> >
>> >
>> >
>
>
> nb data source=|SQLEXPRESS;Integrated
> Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
> Instance=true
.
- Follow-Ups:
- Re: Unable to Locate Server
- From: onecorp
- Re: Unable to Locate Server
- References:
- Re: Unable to Locate Server
- From: Roger Wolter[MSFT]
- Re: Unable to Locate Server
- From: onecorp
- Re: Unable to Locate Server
- From: onecorp
- Re: Unable to Locate Server
- Prev by Date: Re: Unable to Locate Server
- Next by Date: Re: Restore with standby and a different default filegroup
- Previous by thread: Re: Unable to Locate Server
- Next by thread: Re: Unable to Locate Server
- Index(es):
Relevant Pages
|