mysql - 如何从 Windows Mobile 使用 MySQL.Data.CF 连接到 MySQL 服务器

标签 mysql windows-mobile

我有一个在 Windows Mobile 6.5 上的 DataLoxxxgic PDA 扫描仪上运行的小型应用程序。我的应用程序扫描序列号,然后将它们上传到 MySQL 数据库。 我正在使用 Microsoft Visual Studio 2008 和 MySQL.Data.CF 版本。 6.7.4.0。

2天前,我可以完美连接并将记录插入MySQL数据库,没有任何问题。从昨天开始,我不断收到无法连接到任何指定的 MySQL 主机的消息。

我想提一下,有; 1) 没有防火墙阻止 2)我尝试过旧版本的MySQLData.CF。 3) 检查 MySQL 数据库,因为提供的所有信息都是正确的。

连接字符串如下:

    Imports System.Data
    Imports MySql.Data.MySqlClient

    Dim cnnMySQL_Main As MySql.Data.MySqlClient.MySqlConnection
    Dim sConnectionString As String

    sConnectionString = "Server=xxx.xxx.xxx.xxx;"
    sConnectionString = sConnectionString & "Uid=xxxxx;"
    sConnectionString = sConnectionString & "Pwd=xxxxxx;"
    sConnectionString = sConnectionString & "Database=xxxxx;"
    sConnectionString = sConnectionString & "default command timeout=20;"
    sConnectionString = sConnectionString & "Allow Zero Datetime=true"



    'sConnectionString = String.Format("port=3306;server={0};user id={1}; password={2}; database=xxxxxxx; pooling=false", "server=xxx.xxx.xxx.xxx", "xxxxxxx", "xxxxxx")

    cnnMySQL_Main = New MySql.Data.MySqlClient.MySqlConnection(sConnectionString)


    Try


        If cnnMySQL_Main.State = Data.ConnectionState.Closed Then
            cnnMySQL_Main.Open()
            ConnectMySQLDB_main = True
        Else
        End If

    Catch ex As Exception
        MsgBox("Connection Error :  " & ex.Message)
        ConnectMySQLDB_main = False
    Finally
        'ConnectMySQLDB_main = True
    End Try

我尝试了各种选择,但没有成功。

有人可以帮忙吗?

谢谢

最佳答案

我解决了这个问题。相当直接。我已插入 USB 电缆并运行 Active Synch。当我拔掉这根电缆时,我就可以完美连接了!

关于mysql - 如何从 Windows Mobile 使用 MySQL.Data.CF 连接到 MySQL 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19536847/

相关文章:

mysql - 是否可以在 MySQL 中回滚 CREATE EVENT?

SQL 查询返回重复结果

mysql - 无法使 MySQL 功能工作

c# - 如何使用 Windows Mobile 6.1 sdk 在 C# 中获取通话记录

c# - 在 Windows Mobile C# 项目中将文件上传到服务器

PHP PDO 在不同的函数中连接和关闭连接

mysql - 是否可以使用azure在线发布本地数据库?

wpf - Windows Phone 7/WPF - 共享代码库

c# - 为 Windows Mobile 编译时找不到引用的程序集

c# - 在 Windows Phone 8 应用程序中更改全景标题