Short and probably easy question, I don't want to view in dataGridView columnID and few more columns as there is no use of viewing that info.
I have a clear code, the connection is open, the data loads fine and the comment code (btw most common solution in google) gives empty table with all columns (no rows).
I tried so many things that I can't even list them there :(
Any ideas?
DataTable SqlDataTable = new DataTable();
MySqlDataReader reader;
MySqlCommand sqlCommand = new MySqlCommand();
sqlCommand.Connection = sqlConnection;
sqlCommand.CommandText = "SELECT * FROM table_name";
reader = sqlCommand.ExecuteReader();
//while (reader.Read())
//{
// string columnID = reader["columnID"].ToString();
//}
SqlDataTable.Load(reader);
reader.Close();
sqlConnection.Close();
DataGridView = SqlDataTable;