Re: Where is Connector/NET Documentation
Posted by: Oscar Rodríguez
Date: December 28, 2004 11:09PM

Well, i don't have more experience in vb.net, but try using:
Database=your_database; Datasource=localhost; Username=root; pwd=your_pass

2. If solution 1 not result. Try changing of order these sentences:
>myCommand.Connection = myConnection
>
> myConnection.Open()

final:
myconnection.open()
mycommand.connection = myconnection

Michelle Tay wrote:
> Hai,
> I am a beginner to the MySQL..I would like to
> use Connector/Net to link MySQL with VB.Net.
> I am using the local host. I don't know why I
> cant connect to the Database. the error msg state
> that "Access denied for user
> 'username'@'localhost'(using password:YES)"
>
> Here is my code:
> **************
> Imports MySql.data.mySqlClient
>
> Private Sub connectMysql
> Dim myConnection As New MySqlConnection
> myConnection.ConnectionString =
> "server=localhost; database=databaseName;
> uid=username;password=password"
>
> Dim myInsertQuery As String = "INSERT INTO
> tblStaff (s_id, s_pwd, s_fname, s_lname, s_group)
> Values(hdyy, 452287, Panda, Cute, Normal)"
> Dim myCommand As New
> MySqlCommand(myInsertQuery)
> myCommand.Connection = myConnection
>
> myConnection.Open()
>
> MsgBox("Connection ok")
> myCommand.ExecuteNonQuery()
> myCommand.Connection.Close()
>
> End Sub
>
>
> Please help me.. Thank 1st :)
>
>
> regards

Options: ReplyQuote


Subject
Written By
Posted
Re: Where is Connector/NET Documentation
December 28, 2004 11:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.