When you get rid of all the late binding the method is rather simple. It takes a DataSet and a String containing an SQL query, then populates a DataTable in the DataSet and returns a new DataView of that table. I'd suggest you write a method from scratch that does that.