Redian新闻
>
System.Data.SqlClient.SqlException: A network-related or instance -specific error
avatar
System.Data.SqlClient.SqlException: A network-related or instance -specific error# DotNet - 窗口里的风景
w*s
1
my DB is in the local pc, some times my program gave such errors, while most
of the time is ok.
any suggestions ?
Unhandled Exception: System.Data.EntityException: The underlying provider
failed
on Open. ---> System.Data.SqlClient.SqlException: A network-related or
instance
-specific error occurred while establishing a connection to SQL Server. The
serv
er 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 N
etwork Interfaces, error: 50 - Local Database Runtime error occurred. Error
occu
rred during LocalDB instance startup: SQL Server process failed to start.
)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception
, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(
TdsParserStateObj
ect stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
SqlInternal
ConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire,
Bool
ean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean
withFa
ilover)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(
ServerInfo
serverInfo, String newPassword, SecureString newSecurePassword, Boolean
ignoreSn
iOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(
ServerInfo
serverInfo, String newPassword, SecureString newSecurePassword, Boolean
redirect
edUserInstance, SqlConnectionString connectionOptions, SqlCredential
credential,
TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(
TimeoutTime
r timeout, SqlConnectionString connectionOptions, SqlCredential credential,
Stri
ng newPassword, SecureString newSecurePassword, Boolean
redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(
DbConnectionPoolIdent
ity identity, SqlConnectionString connectionOptions, SqlCredential
credential, O
bject providerInfo, String newPassword, SecureString newSecurePassword,
Boolean
redirectedUserInstance, SqlConnectionString userConnectionOptions,
SessionData r
econnectSessionData)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(
DbConnectionOp
tions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo,
DbConn
ectionPool pool, DbConnection owningConnection, DbConnectionOptions
userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(
DbConn
ectionPool pool, DbConnection owningObject, DbConnectionOptions options,
DbConne
ctionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owning
Object, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(
DbConnection o
wningObject, DbConnectionOptions userOptions, DbConnectionInternal
oldConnection
)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(
DbConnection ow
ningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate,
Boolean o
nlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal
& co
nnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(
DbConnection ow
ningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions,
DbCon
nectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(
DbConnection
owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions
userOptions
, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.
TryOpenConnectionInternal(Db
Connection outerConnection, DbConnectionFactory connectionFactory,
TaskCompletio
nSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(
DbConnection
outerConnection, DbConnectionFactory connectionFactory,
TaskCompletionSource`1
retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`
1 re
try)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1
retry)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(
Boolean op
enCondition, DbConnection storeConnectionToOpen, DbConnection
originalConnection
, String exceptionCode, String attemptedOperation, Boolean&
closeStoreConnection
OnFailure)
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(
Boolean op
enCondition, DbConnection storeConnectionToOpen, DbConnection
originalConnection
, String exceptionCode, String attemptedOperation, Boolean&
closeStoreConnection
OnFailure)
at System.Data.EntityClient.EntityConnection.Open()
at System.Data.Objects.ObjectContext.EnsureConnection()
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.
IEnumerable>.GetEnumerator()
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
at System.Data.Objects.ELinq.ObjectQueryProvider.b__3
[TRe
sult](IEnumerable`1 sequence)
at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](
IEnum
erable`1 query, Expression queryRoot)
at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.
IQueryProvider.E
xecute[S](Expression expression)
at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](
Expressi
on expression)
at System.Linq.Queryable.Any[TSource](IQueryable`1 source, Expression`1
predi
cate)
at StockAnalyze.Analyze.ProcessRawData(String stock, Int32 mv_days, Int3
2 p_days)
avatar
H*g
2
SQL server is down
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。