c# - Reading from the stream has failed - MySqlException -
c# - Reading from the stream has failed - MySqlException -
i'm trying open connection mysql database using next code piece:
string connectionstring = "server=ip_number;database=database_name;uid=uid;password=password"; mysqlconnection connection; connection = new mysqlconnection(connectionstring); connection.open();
and here exception get:
i'm using latest mysql connector (downloaded here). missing?
thanks in advance,
may seek this:
connection server:
string connectionstring= "datasource=localhost;port=3306;username=uid;password=1234"
use "mysql-methodes" insert/update/select... like:
public string pathselectdb = "select *from try.data;"; public string pathinsertdb = "insert `try`.`data`"; string constrnig = pathtodb; string query = pathinsertdb +"(`value1`, `value2`) values('"2"','3',');"; mysqlconnection condatabase = new mysqlconnection(constrnig); mysqlcommand cmddatabase = new mysqlcommand(query, condatabase); mysqldatareader myreader;
this example... hope solved problem.
you can set username , password in mysql-editor! if need help there set commend under this.
c# mysql .net database-connection connection-string
Comments
Post a Comment