answersLogoWhite

0

How do you connet sql and vbnet?

User Avatar

Anonymous

13y ago
Updated: 8/20/2019

You can connect MySql and vbnet by download something called MySql Connecter. After you do that add the resource to your project and add this code.

Code:

'Put this at the top of your code

Imports MySql.Data.MySqlClient

'Then right click your form and add this code

Private mysql_host = "Change this to your MySql Host"

Private mysql_user = "Change this to your MySql User"

Private mysql_pass = "Change this to your MySql Password"

Private mysql_db = "Change this to your Database"

Private SqlConnect As String = "server=" + mysql_host + ";user id=" + mysql_user + "; password=" + mysql_pass + "; database=" + mysql_db

Private SqlConnection As New MySqlConnection

'Then double click your form and in the form load put this in.

SqlConnection.ConnectionString = SqlConnect

Try

If SqlConnection.State = ConnectionState.Closed Then

SqlConnection.Open()

MsgBox("Sucessfully Connected To Mysql Database")

Else

SqlConnection.Open()

MsgBox("Connection is closed.")

End If

Catch ex As Exception

MsgBox(ex.Message)

End Try

Their you go, you now you can make a stable connection with your mysql host, and database!

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you save Urdu into Sql Server 2000 using VBNET?

Hi follow this link for save urdu in database using c sharp source code also attach for download.. <a href="http://codingresolved.com/discussion/218/how-to-save-urdu-in-sql-server-using-c#Item_1">http://codingresolved.com/discu ssion/218/how-to-save-urdu-in-sql-server-using-c#Item_1</a>


How do you deploy a VBnet application with SQL database?

The question is too vague and broad to be answered. It's sort of like asking "How do you cook food?" The answer depends on the details of the application and database, and is not a simple straightforward universal process.


Is java better than vbnet?

Java is not better than VBNet, nor is VBNet better than Java. Eachone has its advantages and disadvantaged over the other one.


Can an apple iPod connet to the dsl?

No, srry


Can you connet Pokemon SoulSilver to Pokemon leafgreen?

NO


What is the difference between C and Vbnet?

It is just a different coding language, but C is more for business that VBNET


What is datareader in VBNET?

x


What bone is not connet to other bones?

The hyoid bone


In Pokemon diamond Where do you go in mt connet?

to the top


What is an instance in vbnet?

An instance in VBNet is the same as an instance in any other language; it is the realisation of a type. In object-oriented languages, like VBNet, we say that an object is an instance of a class, where the class defines the object's type.


What is instance in vbnet?

An instance in VBNet is the same as an instance in any other language; it is the realisation of a type. In object-oriented languages, like VBNet, we say that an object is an instance of a class, where the class defines the object's type.


Where could someone find an SQL formatter?

One can find an SQL formatter from: SQL Format, Free Formatter, Poor SQL, T-SQL Tidy, Stack Overflow, SQL Inform, Apex SQL, SQL Parser, Red Gate software, to name a few.