Member Avatar for mrkm1188
mrkm1188

I have a Visual Studio form that is linked to a SQL database table. I am adding a query via a tool strip to search the database and I have the following text boxes the user can enter information into: Client, Project Number, Project Manager, ServerArchived, PaperArchived.

The user does not have to enter info into all the fields, he/she can pick and choose whchih fields to search by.

Im having trouble writing a query that will search the database only on the populated fields that the user fills out. If they leave everyhting but the Project Manager blank i need it to search on just the PM. If they fill in the Client and ServerArchived field i need it to only search on those to fields.

Any suggestions?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.