Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2008 仿真器无法连接到SQL Server_Sql Server 2008_Windows Mobile_Emulation_Windows Mobile 6.5_Pocketpc - Fatal编程技术网

Sql server 2008 仿真器无法连接到SQL Server

Sql server 2008 仿真器无法连接到SQL Server,sql-server-2008,windows-mobile,emulation,windows-mobile-6.5,pocketpc,Sql Server 2008,Windows Mobile,Emulation,Windows Mobile 6.5,Pocketpc,我对编程很陌生。我的公司给了我一些调试代码。我正在测试一个Pocket PC应用程序。无论我做什么,我都无法连接到SQL Server 首先,我得到了服务器不存在的错误。第二次出现错误,比如服务器不可访问。我在vb.net的VS2008中编写了设备应用程序中的简单代码 同样的代码在Windows窗体中运行良好(我能够连接到数据库并提取数据)。但它在设备应用中失败了。我有以下代码: Private Sub Form2_Load(ByVal sender As System.Object, ByV

我对编程很陌生。我的公司给了我一些调试代码。我正在测试一个Pocket PC应用程序。无论我做什么,我都无法连接到SQL Server

首先,我得到了服务器不存在的错误。第二次出现错误,比如服务器不可访问。我在vb.net的VS2008中编写了设备应用程序中的简单代码

同样的代码在Windows窗体中运行良好(我能够连接到数据库并提取数据)。但它在设备应用中失败了。我有以下代码:

 Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim con As SqlConnection
        Dim cmd As SqlCommand
        Dim row As Integer
        'Dim str As String
        con = New SqlConnection("Server=w****b;Database=p***5;User Id=d****;Password=*****;")

        con.Open()

        cmd = New SqlCommand("select * from emp", con)
        row = cmd.ExecuteNonQuery()

        If row > 0 Then
            MessageBox.Show("the row inserted" & row)
        End If

        con.Close()
    End Sub
我将emulator网络属性配置为

启用NE2000 PCMCIA网络适配器并绑定到

连接的网卡

在这之后,我得到了一个新的错误

SQL Server要求对服务器进行加密

我检查了服务器,加密已经启用


有人知道如何使用emulator连接到SQL Server吗?这是一项高优先级的工作,我被卡住了,因为我不能做任何事情,除非我能够连接到数据库。如果您有任何帮助,我们将不胜感激。

AFAIK自Windows XP以来,NE2000模拟networc卡不可用。当我需要网络连接的模拟Windows Mobile映像时,我会使用设备仿真器管理器(独立设备仿真器包的一部分)来“停靠”正在运行的emultaed移动设备。然后,在开发PC上激活WMDC(ActiveSync)并启用Connection:DMA的情况下,模拟设备将连接到PC的网络

在SQL Server上,必须启用TCP/IP传输。在连接字符串中,使用sql server的IP地址

我没有看到标准设置中的“连接必须加密”错误

您还应该查看SQL Server的事件日志以查找连接错误


顺便说一句:只要代码不使用仅限移动设备的API函数,您也可以在PC上运行Windows Mobile compiled exe。

连接字符串中的“Encrypt=true”?感谢您的回复,我可以通过WMDC连接pocketpc 2003第二版模拟器。但我无法使其连接到SQL Server。我收到了与SQL Server要求加密相同的错误。幸运的是,我能够通过实际的pocket PC进行连接。我通过实际的pocket PC进行调试。我在SQL Server中没有看到任何错误日志。