I've been given the task of creating a .net interface for a table that will be retrieved a database.
One of the obvious things that the interface must do is retrieve data from the table.
So.... I could write a function that simply does Select * from MyTable;
and then returns the result. However, the table has ten columns and someone using the interface might want to filter the data by one or more columns. I might need something like Select * from MyTable where LastName like 'A%';
. How can I design my interface to be a flexible single point of entry for downloading data from the table?
I've been told that any solution that involves pulling down the entire table from the server and then filtering the results in the .net code is unacceptable due to bandwidth concerns.
Note: I would also like to add that the code retrieving the data from the SQL table is called as a WCF service; however the data is retrieved, it must be returned to the caller as serializable data, not as any kind of reference.
Clarification: By "interface", I simply meant a function that is called to retrieve data from a SQL table. I realize that the term "interface" is a bit confusing. There is a word for exactly what I'm doing, but I don't know what it is.