but it gives the error message "invalid column name"
It simply means that the insert query formed has an invalid column name.
Simply put a break point before query execution, use DEBUGGER and see what is the formed query:
StrQuery = @"INSERT INTO CategorynA VALUES (" + dataGridView1.Rows[i].Cells["clmCategory"].Value + ", " + dataGridView1.Rows[i].Cells["clmActivity"].Value + ");";
Verify it by directly running in SQL server to see if it is fine. Check the column name set is present in table.