0% found this document useful (0 votes)
14 views1 page

Setting String Connection: Imports Imports Imports

This document discusses connecting a VB.NET application to a MySQL database. It defines a connection string variable that specifies the server, username, password, and database. It also includes a method to open the connection that checks if it is closed first and then opens it if so.

Uploaded by

Richard Abraham
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Setting String Connection: Imports Imports Imports

This document discusses connecting a VB.NET application to a MySQL database. It defines a connection string variable that specifies the server, username, password, and database. It also includes a method to open the connection that checks if it is closed first and then opens it if so.

Uploaded by

Richard Abraham
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Koneksi VB.

NET menggunakan MYSQL


Setting String Connection Imports System Imports System.Data Imports MySql.Data.MySqlClient Module Module1 Public strConn As String = " SERVER = localhost ; " & _ "UID=root;" & _ "PWD=;" & _ "DATABASE =db_kontrakan;" End Module

Buka Koneksi Public Sub connect() cnn = New MySqlConnection(strConn) If cnn.State <> ConnectionState.Closed Then cnn.Close() cnn.Open() End Sub

You might also like