读/写在线数据库 [英] Read / Write to online database

查看:89
本文介绍了读/写在线数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Guys



我正在寻找一个简单的在线数据库(像云一样)

我需要能够读写对它来说。



我找到了 www.freemysqlhosting.net [ ^ ]

它是我正在寻找的那种



唯一的问题是我无法通过VB.NET连接到它



我收到错误

Hi Guys

Im looking for an easy online database (Like a Cloud)
I need to be able to read and write to it.

I found www.freemysqlhosting.net[^]
its sort of what im looking for

the only problem is that i cant connect to it via VB.NET

I get error

"Access denied for user `sql12345`@`10.0.29.7`(using password:YES)"





这里是使用的代码:





here is the code im using:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim conStr As String = "Server=sql3.www.freemysqlhosting.net; Port=3306; User id=sql12345; password=*******; Database=sql12345; Connect Timeout=60;"
        Dim con As New MySqlConnection(conStr)
        Try
            MessageBox.Show("Connecting to mysql database.")
            con.Open()
            Dim sqlStr As String = "SELECT * FROM Users"
            Dim cmd As MySqlCommand = New MySqlCommand(sqlStr, con)
            Dim rd As MySqlDataReader = cmd.ExecuteReader
            rd.Read()

            If rd.HasRows Then
                MessageBox.Show(rd(0) & " " & rd(1) & " Msg here")
                Exit Sub
            Else
                MessageBox.Show("Could not find something")
                Exit Sub
            End If

            con.Close()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub



也许有人可以指出我正确的方向。

也许ev建议一个工作且可靠且经过测试的在线数据库。



谢谢你们这些人b / b

马里奥





[edit]已添加代码块和可点击链接[/ edit]


maybe someon can point me into the right direction.
maybe even suggest an online DB that works and is reliable and tested.

thanks guys

Mario


[edit]Code blocks added and clickable link[/edit]

推荐答案

检查您是否可以使用这些凭据访问数据库。检查你的连接字符串。
Check if you have access to the database with these credentials. Check your connection string as well.


这篇关于读/写在线数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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