I want to insert the numbers entered in a datagridview to a database table. Whenever I do this, only 0 is entered in the table no matter whatever number is entered in the datagridview. Here is my code..
decimal num=Convert.ToDecimal(amountdataGridView.Rows[0].Cells["amountColumn"].Value);
cmd = new SqlCeCommand("insert into Deposit values('" + num + "')", con);
cmd.ExecuteNonQuery();