Click here to Skip to main content
14,699,107 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to connect my .net application with mysql
pls tell the code to do this
thank you

Check this[^]

To find proper connection string, visit[^]
1. Download Mysql connector from following link and install[^]
2. Add Reference (MySQL.Data)
3. Namespace
Imports MySql.Data;
Imports MySql.Data.MySqlClient;

4. Connection String

Private Sub ConnectDataBase()
            Dim con As MysqlDbConnection
            Dim ConStr As String
            ConStr = "Server=Localhost;Database=dbTesting;Uid=root;Pwd=password;"

            con = New MYsqlDbConnection(ConStr)

        Catch ex As Exception
            Throw ex
        End Try
    End Sub
anand4886 31-Mar-12 7:17am
how can i add refrence ,it is showing some error
Manoj Kumar Choubey 31-Mar-12 7:20am
what error message ?
Manoj Kumar Choubey 31-Mar-12 7:23am
see following link :
anand4886 31-Mar-12 7:25am
when i select add refrence than a dialog box appears and it contains .net,com,project,browse,recent,which opttion should i search or select
hi there,

but what you want to do? insert , update, delete, search, what?
anand4886 31-Mar-12 6:48am
i want to insert data in the table from
Aniruddh Bhatt 31-Mar-12 6:49am
ok do you have a knowledge of query string?
anand4886 31-Mar-12 6:50am
i have done this with access but i want to do this with mysql
Aniruddh Bhatt 31-Mar-12 6:53am
ok do you have a insert code for access if yes then you need to change only connection string.
if any query send your code i will solve it.
anand4886 31-Mar-12 6:55am
i know insert code,pls tell me abt connection string
Aniruddh Bhatt 31-Mar-12 6:58am
but what is your connection string, connection string make connection between sql and

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