Click here to Skip to main content
15,905,558 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a datagrid in wpf application. When i click the button there a query that results in 1 row.
I want to add that row to the datagrid. I tried this but giving empty

cmd.CommandText = "SELECT * FROM PRICELIST WHERE ID=14200";
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataTable MedTable = new DataTable();
da.Fill(MedTable);
DataRow rw = MedTable.Rows[0];
// MessageBox.Show(rw[0].ToString());
MedicineTable.Items.Add(rw);

Although when i print rw[0] its giving the right result but in datagrid, its just adding empty row.
Posted
Comments
Ezra Neil 14-Jun-13 23:24pm    
Show us the code where you bind or assign the datatable to your datagrid

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900