//dataGridView1.AutoResizeColumns( // DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader); } catch (SqlException) { MessageBox.Show("To run this example, replace the value of the "+ "connectionString variable with a connection string that is "+ "valid for your system."); } }