Complete SQL statements can not be run on a dataset, but the datatable inside dataset does have a method called Select(string) which selects an array of DataRow object that match a certain criteria.
E.g. if I have a dataset named ds that contains data. This data has a table students with fields like firstname and lastname. Let's say I want to run a query to find students with lastname as 'johnson'.
The SQL syntax would be
DataTable tblStudents = dsView.Tables["STUDENTS"]; DataRow[] results = tblStudents.Select("lastname = 'johnson'");
Get Answers For Free
Most questions answered within 1 hours.