System.Web.Services.Protocols.SoapException: 服务器无法处理请求。 ---> System.Data.OleDb.OleDbException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或拒绝访问。
在 System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
在 System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
在 System.Data.OleDb.OleDbConnection.Open()
在 System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
在 BOrders.QueryOrders(MOrder mo) 位置 E:\test_mdb\Borders\App_Code\BOrders.vb:行号 74
--- 内部异常堆栈跟踪的结尾 ---
-
<connectionStrings>
-
<add name="eShopConnectionString" connectionString="provider=sqloledb;server=.;database=eShop;uid=eshoper;pwd=123" providerName="System.Data.OleDb"/>
-
</connectionStrings>
如果在当前主机localhost上不止一个数据库实例,那么"server=."就是不正确的,同样也是找不到数据库的,就出现了“
SQL Server 不存在或拒绝访问”的现象,这时用具体的实例名替代就可以解决问题!
-
<connectionStrings>
-
<add name="eShopConnectionString" connectionString="provider=sqloledb;server=PCSERVER-0825\SQLEXPRESS;database=eShop;uid=eshoper;pwd=123" providerName="System.Data.OleDb"/>
-
</connectionStrings>
一切OK
阅读(3416) | 评论(0) | 转发(0) |