11/21/2023 0 Comments Linux mysql connect to remote database![]() This settings can work daily for those who are in static ip. Private Sub btn_exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_exit.Clickħ) Run the project and try the connection if the connection is successfully then your luck and if the connection is not successfully with the following error message worry not just keep reading more Ĩ) Note the ip address on error message after (thats your ip) and add it to your domain cpanel "remote mysql access" the image bellow illustrates how the remote mysql access looks like(they are the same bu they may defer in colors) Don't forget to press "add hosts" button. Private Sub btn_connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_connect.Click If _connection.State = ConnectionState.Open Then _connection.ConnectionString = "Server=" & _servername & " Port=3306 Database=" & _databasename & " User ID=" & _userid & " Password=" & _password & "" Public ReadOnly Property ErrorMessage() As String Public WriteOnly Property Password() As String Public WriteOnly Property UserID() As String Public WriteOnly Property DatabaseName() As String Public WriteOnly Property ServerName() As String Public Class Database Private _connection As New MySqlConnection To connect vb.net to remote MySql database No matter what VB.Net version you might be using, just go throw the following steps.ġ) Download Mysql Connector/Net from the url ( )Ģ) Install the connector by default the connector will be installed in the path (C:\Program Files\MySQL\Connector Net 6.9.6) that's the version i have installed.ģ) Open VB.Net IDE and start the new project.Ĥ) Add the "" as a reference to your project, which you can find it in the path (C:\Program Files\MySQL\Connector Net 6.9.6\Assemblies\v4.5) ĥ) Prepare your connection form as shown in this image Ħ) Create the class named "Database" and write in the following code. ![]() Connect to remote MySQL Database Using VB.Net
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |