I have a program that throws syntax error at ExecuteReader part

I want to display a select statement in my server program which goes like this

string gethostname_id = "SELECT INTO chtbuster.hostnametable(hostName_id) WHERE (hostName=@machineName)"; MySqlCommand cmd2Database = new MySqlCommand(gethostname_id, conDataBase); cmd2Database.Parameters.AddWithValue("@machineName", machineName); cmd2Database.ExecuteReader(); 

The error points at cmd2Database.ExecuteReader(); with a particular error of Syntax error near 'INTO chtbuster.hostnametable (hostName_id) WHERE (hostName =' UNICORNV-FA15C8 ')' at line 1

I've searched questions with the same problem but it still produce the same error. Pls help

by front11 via /r/csharp

Leave a Reply