From: trant on
I have having difficulty figuring out how to insert into a MySql database
using C# and MySql Connector.

I looked over several tutorials now I I seem to have everything correct but
for some reason values never get inserted into my table, everything is NULL!

here is my code:

MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = new MySqlCommand("INSERT INTO mytable (name) VALUES
(@name)", connection);
command.Parameters["@name"].Value = "test";

It inserts a row into my table but everything is NULL.

If I run this same query right into a mysql console (substituting the
parameter of course_ it works fine.

What did I do wrong?