MySQL Forums
Forum List  »  MySQL for Visual Studio

mySQL connection string problems using visual studio 2013
Posted by: Bob Herrmann
Date: February 26, 2015 10:36AM

I am new to mySQL. I have always used MS SQL in the past. I can't seem to get my conncetion string working. Here is my connection string:

<add name="MRIXXX" connectionString="server=localhost; User ID=xxxh; Password=Xyyyyy99; database=HiXXXXXXXDB" providerName="System.Data.SqlClient"/>

And here is my C# code where I try to connect:

string connString = ConfigurationManager.ConnectionStrings["MRIXXX"].ConnectionString;

MySqlConnection connection = new MySqlConnection(connString);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
string thisrow = "";
command.CommandText = "select * from Products";
connection.Open();
Reader = command.ExecuteReader();
while (Reader.Read())
{
for (int i = 0; i < Reader.FieldCount; i++)
thisrow += Reader.GetValue(i).ToString() + ",";
//gvProducts.Rows.Add(thisrow);
}

lblProductID.Text = thisrow;
connection.Close();

I get this error when I run it:

[MySqlException (0x80004005): Authentication to host 'localhost' for user 'xxxh' using method 'mysql_native_password' failed with message: Access denied for user 'xxxh'@'localhost' (using password: YES)]

What am I doing wrong?

Options: ReplyQuote


Subject
Views
Written By
Posted
mySQL connection string problems using visual studio 2013
3396
February 26, 2015 10:36AM


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.