Pages

Search This Blog

Sunday, 9 February 2014

VB.NET/MySql- Access Denied @localhost(using password:NO)

This error when your code looks like:

con.Open();
con.ConnectionString="server=localhost;database=sample;username=root;password=****";

The statement con.ConnectionString should come before con.Open(). So the actual correct code is:

con.ConnectionString="server=localhost;database=sample;username=root;password=****";
con.Open();

con is an object of Connection class.

No comments:

Post a Comment