I am working on a .NET project where I am trying to change the column heading names in datagridview by using sqlquery but for unknown reason I am unable to do so . However the problem has been countered by using below code
dataGridView.Columns.HeaderText = "Last_Sale_Date"
dataGridView.Columns.HeaderText = "last sale to party"
but I still don't know the exact reason why the sqlquery is not working properly .
Can anyone help me out in this matter
string query = "SELECT $_LastSaleDate AS 'Last_Sale_Date', $_LastSaleParty AS 'last sale to party', $_LastSalePrice AS 'last sold price', $Name AS 'name of party', $_ClosingBalance AS 'closing balance' FROM ItemMovementAnalysis WHERE ($_ClosingBalance = 1511) ";
using (OdbcDataAdapter dadapter = new OdbcDataAdapter(query, con))
DataTable table = new DataTable();
this.dataGridView1.DataSource = table;