I'm new to SQL and I'm having problems getting a search function to work with the data grid view. I've got a form set up for the search function with multiple text boxes for the user to enter information and a function that performs that search via the table adapter. My search function looks like this:
I can't figure out how to get that result to display in the data grid view though. Any suggestions as to how to resolve this, or a better way to achieve the same result would be greatly appreciated. Thanks in advance.Code:SELECT Amount, Date, Department, PO_Numbers, Requester FROM PO WHERE (Amount = 'txtSearchAmount.Text') OR (Requester = 'txtSearchRequester.Text') OR (Department = 'txtSearchDepartment.Text') OR (PO_Numbers = 'txtSearchPO.Text') ORDER BY PO_Numbers DESC
Edit: Forgot to mention I'm using visual studio 2005, and sql server 2005.




Reply With Quote