I am new on C# . I create a C# Console program and insert some data to MySql by following code .
string connection = "Server=localhost;Database=user_table;Uid=root;Pwd=";
MySqlConnection dbcon = new MySqlConnection(connection);
MySqlCommand cmd;
dbcon.Open();
cmd = dbcon.CreateCommand();
cmd.CommandText = "INSERt INTO user_table(user_name,amount) VALUES(@user_name,@amount)";
cmd.Parameters.AddWithValue("@user_name","Niloy");
cmd.Parameters.AddWithValue("@amount", "456");
cmd.ExecuteNonQuery();
Now I want to retrieve this data and display in console application .
like This
Niloy 234
Joy 500
Minal 230
how can i do this ?