MySQL Forums :: MySQL for Visual Studio :: SQL Connection Error


Advanced Search

Re: SQL Connection Error
Posted by: Luis Penunuri ()
Date: May 12, 2016 03:09PM

Hi Joshua,

Thanks for using MySQL as your Database provider and for writing in our forums.

I set up a fresh MySQL Server 5.7.12, using the my.ini file you provided before, and was able to "select" and "insert" data into a table successfully, using a connection string like yours:

<add name="constr" connectionString="Server=127.0.0.1;Port=3306;Database=test;Uid=root;Pwd=****;" />
.
.
.
protected void Button1_Click(object sender, EventArgs e)
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (MySqlConnection con = new MySqlConnection(constr))
{
using (MySqlCommand cmd = new MySqlCommand("insert into table1 values (3, 'test3');"))
{
con.Open();
cmd.Connection = con;
cmd.ExecuteNonQuery();
con.Close();
}
}
}

Can you please provide more information (the inner exception, stack trace, etc.) about the error you are getting when executing an insert command ?

That would be very helpful for us in order to try to get the root cause of the error you are getting.

Thanks in advance, and have a good one !

Options: ReplyQuote


Subject Views Written By Posted
SQL Connection Error 840 Joshua Golding 04/27/2016 02:46PM
Re: SQL Connection Error 410 Joshua Golding 04/29/2016 01:10PM
Re: SQL Connection Error 456 Luis Penunuri 05/12/2016 03: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.