dataGridView1.DataSource = null; dataGridView1.Rows.Clear(); SqlConnection cn = new SqlConnection(); SqlCommand cmd = new SqlCommand(); cn.ConnectionString = @"CONNECTION STRING"; cmd.Connection = cn; cmd.Connection.Open(); cmd.CommandText = $"SELECT * FROM Table where column3!= '' "; SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); BindingSource source = new BindingSource(); source.DataSource = dt; dataGridView1.DataSource = dt;
Quote:I managed to get unstuck by copying the columns I wanted to edit to new columns, and then removing the old. Works like a charm!
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)