I'm pretty sure it's the way you've named your columns and your sql parameters. Try this instead
sqlcomm.CommandText = "Insert into data ([TOP(1)],[TOP(2)] ) values(@TOP1,@TOP2)";
try
{
sqlcomm.Parameters.AddWithValue("@TOP1", dataGridView1.CurrentRow.Cells["TOP(1)"].Value.ToString());
sqlcomm.Parameters.AddWithValue("@TOP2", dataGridView1.CurrentRow.Cells["TOP(2)"].Value.ToString());
sqlcomm.ExecuteNonQuery();
Points to Note:
- the square brackets around the column names - they'd be illegal otherwise.
- The
@
symbols when adding the parameters
- Removal of the (illegal) characters in the parameter names -
TOP(1)
becomes
@TOP1