Is there a way (similar to the below code) to delete all the rows in a specified table using c#?
SqlConnection con = new SqlConnection(conString);
string sql = @"DELETE*FROM compsTickers;";
SqlCommand cmd = new SqlCommand(sql, con);
Incorrect syntax near '*'
There's nothing wrong with your C# code; that's an SQL syntax error.
Anyway, there's no need for the
*. You delete rows, not columns, from a table, so you don't specify columns to delete:
DELETE FROM compsTickers