hi guys i have existing column in datagridview sample column name (Student ID, Last Name) now i have mysql table column name sample(STUD_ID,LNAME) STUD_ID = int Type, LNAME= varchar Type.
i used these code to display mysql table in datagridview if their is no Existing column
void dlist(string sqlQry, DataGridView dgv)
{
Con.Open();
DataTable dt = new DataTable();
MySqlCommand cmdSql = new MysqlCommand(sqlQry,Con);
MySqlDataAdapter da = new MySqlDataAdapter(cmdSql);
da.Fill(dt);
dgv.DataSource = dt.DefaultView;
Con.Close();
}
My problem Is I want To display mysql table column name (STUD_ID) Value to existing datagridview Column name (Student ID) and (LNAME) to (Last Name) need some help thank you very much in the future.