If I try your code in my test app:
DataTable dt = new DataTable();
string strConnect = SMDBSupport.SMInstanceStorage.GetInstanceConnectionString("VideoMaster");
using (SqlConnection con = new SqlConnection(strConnect))
{
try
{
con.Open();
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM Videos", con);
da.Fill(dt);
MyDataGridView.DataSource = dt;
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
MyDataGridView.Columns[1].DefaultCellStyle.BackColor = Color.LightPink;
MyDataGridView.Columns[2].DefaultCellStyle.BackColor = Color.LightGreen;
I get what I expected: the second column has a pink background and the third has a green.
So you need to look at exactly what you see on your screen - which we can't look at - and also at the rest of your code to see what it is doing to your DGV.