Govind Sankar
Active member
- Joined
- May 15, 2020
- Messages
- 42
- Programming Experience
- Beginner
Hi I created a sql server database and is using a dataset in visual studio to connect to the sql server database and I am using wpf application with a datagrid. Now in one section i need to use dataview.rowfilter.
But i need to use multiple columns to filter row in dataview. For eg I use the dataview like this
DataView View = SchoolDataset.Marks.DefaultView;
View.RowFilter = string.Format("ID = '{0}' ", ID};
this works correctly. But this will show multiple rows with the same ID.
or
DataView View = SchoolDataset.Marks.DefaultView;
View.RowFilter = string.Format("ExtracurricularActivity = '{0}' ", EA};
and this will also work, but will again show multiple rows with the same extracurricularactivity EN.
I need it to show it as one row. That if ID is 1 and extracurricularactivity is drama. Then I need the datagrid to show the row with both ID as 1 and EN as drama. There will only be one row. So how can I do that. Thank you.
But i need to use multiple columns to filter row in dataview. For eg I use the dataview like this
DataView View = SchoolDataset.Marks.DefaultView;
View.RowFilter = string.Format("ID = '{0}' ", ID};
this works correctly. But this will show multiple rows with the same ID.
or
DataView View = SchoolDataset.Marks.DefaultView;
View.RowFilter = string.Format("ExtracurricularActivity = '{0}' ", EA};
and this will also work, but will again show multiple rows with the same extracurricularactivity EN.
I need it to show it as one row. That if ID is 1 and extracurricularactivity is drama. Then I need the datagrid to show the row with both ID as 1 and EN as drama. There will only be one row. So how can I do that. Thank you.