Click here to Skip to main content
15,886,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

VB
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

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]
Posted
Updated 15-Feb-14 1:28am
v3

1 solution

Check if you have access to the database with these credentials. Check your connection string as well.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900