answersLogoWhite

0

How do you connet sql and vbnet?

Updated: 8/20/2019
User Avatar

Wiki User

12y ago

Best Answer

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

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you connet sql and vbnet?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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.


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


Can you connet Pokemon SoulSilver to Pokemon leafgreen?

NO


Can an apple iPod connet to the dsl?

No, srry


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.


IS VBNet purely objet oriented?

no


Who is the father of vbnet?

Alan Cooper


In Pokemon diamond Where do you go in mt connet?

to the top