Reputation: 5325
Hi i want to add the result of sql query to datagrid in my WPF application. I use SQL to LINQ to fetch data.Please help me.
Upvotes: 1
Views: 246
Reputation:
Just Set the ItemSource property of the DataGrid to the value of the result of that query using C# :
dataGrid1.ItemSource = query ;
ensure you set the AutoGenerateColumns property into true in XAML
<DataGrid x:Name="dataGrid1"
AutoGenerateColumns="True" />
Upvotes: 1