我的应用程序不适用于sql server local db 2012 [英] My application won't work with sql server local db 2012

查看:80
本文介绍了我的应用程序不适用于sql server local db 2012的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的程序中使用了两个版本的mdf文件,一个是使用sql express,一个是使用localdb / ver 11,安装我的应用程序和sql local db 2012后我在启动时遇到了这个错误程序:

在你的计算机上找不到sql引擎。或者那样......

这是否意味着我应该安装sql express 2012?我的意思是微软创建了sql server本地数据库的小尺寸。



我的错误:

发生网络相关或特定于实例的错误同时与

SQL服务器建立连接。找不到服务器或无法访问服务器。

Verift实例名称正确并且SQL服务器配置为允许远程连接。

(提供者:SQL网络接口) ,错误26-错误找到指定的服务器/实例)







请参阅结束  此消息 详细信息 on 调用
实时(JIT)调试,而不是 此对话框。





**************异常文本*********** ***

 System.Data.SqlClient.SqlException(0x80131904):发生与网络相关或特定于实例的错误建立与SQL Server的连接。服务器未找到或无法访问。验证实例名称是否正确,并且SQL Server  配置为允许远程连接。 (提供程序:SQL网络接口,错误: 26   - 找到指定的服务器/实例时出错)
在System.Data.SqlClient.SqlInternalConnection.OnError(SqlException异常, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo) ,SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt,布尔 trustServerCert,布尔 integratedSecurity)
在System.Data.SqlClient。 SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout,TimeoutTimer timeout,S qlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance,SqlConnection owningObject,SqlConnectionString connectionOptions,TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject,TimeoutTimer timeout,SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity,SqlConnectionString connectionOptions,对象 providerInfo,字符串 newPassword,SqlConnection owningObject, Boolean redirectedUserInstance)$ b System.Data上的$ b .SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项,对象 poolGroupProviderInfo,DbConnectionPool池,DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection) ,DbConnectionPool池,DbConnectionOptions选项)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System。 Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory) System.Data.Linq.SqlClient.SqlConnectionManager.U上的System.Data.SqlClient.SqlConnection.Open()

seConnection(IConnectionUser用户)
at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
at System.Data。 System.Data.Linq上的System.Data.Linq.Table`1.GetEnumerator()
中的Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(表达式查询)
。表`1.System.Collections.Generic.IEnumerable< tentity> .GetEnumerator()
在System.Collections.Generic.List`1..ctor(IEnumerable`1集合)
在System.Linq。 Enumerable.ToList [TSource](IEnumerable`1 source)
在System.Data.Linq.Provider.BindingList.Create [T](DataContext context,IEnumerable`1 sequence)
at System.Data.Linq .Table`1.GetNewBindingList()
at System.Data.Linq.Table`1.System.ComponentModel.IListSource.GetList()
at System.Windows.Forms.CurrencyManager.SetDataSource(对象 dataSource)
在System.Windows.Forms.CurrencyManager .. ctor( Object dataSource)
at System.Windows.Forms.BindingContext.EnsureListManager( Object dataSource , String dataMember)
at System.Windows.Forms.DataGridView.DataGridViewDataConnection.ShouldChangeDataMember( Object newDataSource)
at System.Windows.Forms.DataGridView.set_DataSource( Object value
在Serial_port_exporter.Form1.Form1_Load( Object sender,EventArgs e) in I:\ Majid项目\Serial port exporter \majid-serial port exporter-1-14-2013 \Serial port exporter 2 \ Serial port exporter \Form1.cs:line 753 >
()
在System.Windows.Forms.Control.CreateControl( Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl() System.Windows.Forms.Control.WmShowWindow上的
(消息& m)System.Windows.Fornd.Fornd.Conp.WandProc(Message& m)
$。System.Windows.Fornd.S.SrollableControl.WndProc(Message& m)
System.Windows.Forms
.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)$在System.Windows.Forms.Control.ControlNativeWindow.WndProc(消息& m)的
在System.Windows.Forms.NativeWindow.Callback( IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


**************已装载的装配**************
mscorlib
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 (RTMRel.030319- 0100)
CodeBase:file: /// C:/Windows/Microsoft.NET/Framework/v4。 0.30319 / mscorlib.dll
------------------------------------- ---
串口导出器
汇编版本: 1 0 。< span class =code-digit> 0 。 0
Win32版本: 1 0 0 0
CodeBase:file: /// C:/ Users / Farzad / AppData / Roaming / Locator / Serial% 20port%20exporter.exe
------------------------------------- ---
System.Windows.Forms
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 构建者:RTMRel
CodeBase:file: /// C :/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
--------- -------------------------------
System.Drawing
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 内置:RTMRel
CodeBase:file: /// C:/ Window s / Microsoft.Net / assembly / GAC_MSIL / System.Drawing / v4.0_4.0.0.0__b03f5f7f11d50a3a / System.Drawing.dll
--------------- -------------------------
系统
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 内置:RTMRel
CodeBase:file: /// < span class =code-comment> C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
------- ---------------------------------
ZedGraph
汇编版本: 5 1 5 28844
Win32版本: 5 1 5 28844
CodeBase:file: /// C:/Users/Farzad/AppData/Roaming/Locator/ZedGraph.DLL
----------------------------------------
System.Data
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 (RTMRel.030319-0100)
CodeBase :file: /// C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4 .0.0.0__b77a5c561934e089 / System.Data.dll
-------------------------------- --------
System.Core
汇编版本: 4 0 0 0
Win32版本:< span class =code-digit> 4 。 0 30319 1 内置:RTMRel
CodeBase:file: /// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------- -----------------------------
System.Xml
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 内置:RTMRel
CodeBase:file: // / C:/Windows/Microsoft.Net/as sembly / GAC_MSIL / System.Xml / v4.0_4.0.0.0__b77a5c561934e089 / System.Xml.dll
--------------------- -------------------
System.Data.DataSetExtensions
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 内置:RTMRel
CodeBase:file: /// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
- ---------------------------------------
System.Numerics
汇编版本: 4 0 0 0
Win32版本:< span class =code-digit> 4 。 0 30319 1 内置:RTMRel
CodeBase:file: /// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------- -----------------------------
System.Data.Linq
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1
CodeBase:file: /// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Linq.dll
------------------ ----------------------
System.Configuration
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 . 1 (RTMRel.030319-0100)
CodeBase:file: /// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
- ---------------------------------------
System.Transactions
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 (RTMRel.030319-0100)
CodeBase:file: /// C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------- -----------------------------
System.EnterpriseServices
汇编版本: 4 0 0 0
Win32版本: 4 0 30319 1 (RTMRel.030319-0100)
CodeBase:file: /// C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll

----------------------------------------



************** JIT调试**************

启用实时(JIT)调试,这个

应用程序的.config文件或者计算机(machine.config)必须在system.windows.forms部分设置

jitDebugging值。

应用程序也必须使用调试编译

启用。



例如:



< configuration>

< system.windows.forms jitdebugging =true>





启用JIT调试时,任何未处理的异常

将被发送到在计算机上注册的JIT调试器

而不是由此对话框处理。

解决方案

您可能已经看过这个,但我认为无论如何我都会通过它: SQL Server Expres 2012 local ... [ ^ ]

它可能就像你的连接字符串不正确一样简单,因为我链接到的链接来讨论特殊连接字符串。

使用LocalDB的最简单方法是使用连接字符串Server =(localdb)\v11.0; Integrated连接到当前用户拥有的自动实例安全性=真。要使用文件名连接到特定数据库,请使用类似于Server =(LocalDB)\ v11.0; Integrated Security = true; AttachDbFileName = D:\ Data\MyDB1.mdf的连接字符串进行连接。

I used two version of mdf file in my program, one is working with sql express, and one is working with localdb/ver 11, after installation of my application and sql local db 2012 i got this error at the startup of my program:
can not find sql engine in your computer.or sth like that.
Does it mean i should instal sql express 2012? I mean microsoft created the sql server local db with small size.

my error:
A network-related or instance-specific error occured while establishing a connection to
SQL server. The server was not found or was not accessible.
Verift that the instance name is correct and that SQL server is configured to allow remote connections.
(provider: SQL Network inteface, error 26-Error Locating server/instance specified)



See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.



************** Exception Text **************

System.Data.SqlClient.SqlException (0x80131904): 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)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
   at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
   at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
   at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
   at System.Data.Linq.Table`1.GetEnumerator()
   at System.Data.Linq.Table`1.System.Collections.Generic.IEnumerable<tentity>.GetEnumerator()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at System.Data.Linq.Provider.BindingList.Create[T](DataContext context, IEnumerable`1 sequence)
   at System.Data.Linq.Table`1.GetNewBindingList()
   at System.Data.Linq.Table`1.System.ComponentModel.IListSource.GetList()
   at System.Windows.Forms.CurrencyManager.SetDataSource(Object dataSource)
   at System.Windows.Forms.CurrencyManager..ctor(Object dataSource)
   at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)
   at System.Windows.Forms.DataGridView.DataGridViewDataConnection.ShouldChangeDataMember(Object newDataSource)
   at System.Windows.Forms.DataGridView.set_DataSource(Object value)
   at Serial_port_exporter.Form1.Form1_Load(Object sender, EventArgs e) in I:\Majid projects\Serial port exporter\majid-serial port exporter-1-14-2013\Serial port exporter 2\Serial port exporter\Form1.cs:line 753
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Serial port exporter
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Farzad/AppData/Roaming/Locator/Serial%20port%20exporter.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
ZedGraph
    Assembly Version: 5.1.5.28844
    Win32 Version: 5.1.5.28844
    CodeBase: file:///C:/Users/Farzad/AppData/Roaming/Locator/ZedGraph.DLL
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data.DataSetExtensions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Data.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Linq.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll

----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitdebugging="true">


When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

解决方案

You may have seen this already, but I thought I''d pass it on anyway: SQL Server Expres 2012 local...[^]
It could be as simple as your connection string not being correct as the source I linked to talks about a "special connection string".

The easiest way to use LocalDB is to connect to the automatic instance owned by the current user by using the connection string "Server=(localdb)\v11.0;Integrated Security=true". To connect to a specific database by using the file name, connect using a connection string similar to "Server=(LocalDB)\v11.0; Integrated Security=true ;AttachDbFileName=D:\Data\MyDB1.mdf".


这篇关于我的应用程序不适用于sql server local db 2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆