I am confused...
I am making an error list tool to consolidate fixes for computer issues for my job.
I am trying to make an asp.net page to search multiple fields.
I have a tblError
SoftwareID
ErrorDescription
EventID
ErrorCode
The problem is I want to be able to search 1 field, or all 4 at the same time. I added a sqladapter and bound my where clause to my controls textbox fields. The problem is, something has to be entered in every field for it to conduct a search. Is there a magic * to search everything regardless if that field is empty that I can throw in my default value field if nothing is entered?
Here is my select statement
SELECT * FROM [TBLError] WHERE (([EventID] = @EventID) AND ([SoftwareID] = @SoftwareID) AND ([ErrorDescription] LIKE '%' + @ErrorDescription + '%') AND ([ErrorCode] LIKE '%' + @ErrorCode + '%'))
I appologize in advance, I do not know if i should post in the sql forum.
Thanks
I am making an error list tool to consolidate fixes for computer issues for my job.
I am trying to make an asp.net page to search multiple fields.
I have a tblError
SoftwareID
ErrorDescription
EventID
ErrorCode
The problem is I want to be able to search 1 field, or all 4 at the same time. I added a sqladapter and bound my where clause to my controls textbox fields. The problem is, something has to be entered in every field for it to conduct a search. Is there a magic * to search everything regardless if that field is empty that I can throw in my default value field if nothing is entered?
Here is my select statement
SELECT * FROM [TBLError] WHERE (([EventID] = @EventID) AND ([SoftwareID] = @SoftwareID) AND ([ErrorDescription] LIKE '%' + @ErrorDescription + '%') AND ([ErrorCode] LIKE '%' + @ErrorCode + '%'))
I appologize in advance, I do not know if i should post in the sql forum.
Thanks