Okay, I have a form that has a search capability for three fields
Customer First Name, Customer Last Name, Customer ID
The data resides in SQl Server
I am using a Like command with % on Each side of the text passed across.
How would you write the method to use build a SQL including all or one of the fields.
Would you pass across all fields and then in the business logic determine which method to call,
or would you build an if structure to concat a series of strings to dynamically make the where clause.
Would it be a series of methods with different parameters
public DataSet GetCustomers()
public DataSet GetCustomers(string custid)
public DataSet GetCustomers(string custID, string firstname)
public DataSet GetCustomers(string custid, string firstname, string lastname)
I can't create nay more because the pattern would not be unique, the other members would be "string, string" so C# would complain.
Or would I create
GetCustomers_ID()
GetCustomers_ID_Lastname()
GetCustomers_ID_firstname()
GetCustomers_lastname()
GetCustomers_firstname()
GetCustomers_lastname_firstname()
Ideas!!!!!!