Question: Searching in sql server with c#.There are many textbox and many probability.. User not have to populating all fields I will do a search in

 Searching in sql server with c#.There are many textbox and many

Searching in sql server with c#.There are many textbox and many probability..

User not have to populating all fields

I will do a search in the database, if there are sections that are empty, should I type a query one by one? If all the pieces are filled in, my code will be:

SELECT * from Thesis AS T INNER JOIN Person AS A ON A.PersonID=T.AuthorID AND A.PersonFullName='Author name' INNER JOIN Person AS S ON S.PersonID=T.SupervisorID AND S.PersonFullName='supervisor' LEFT OUTER JOIN Person AS CS ON CS.PersonID=T.SupervisorID AND CS.PersonFullName='cosupervisor' INNER JOIN Enstitute AS E ON E.EnstituteID=T.EnstituteID AND E.EnstituteName=' enstitutename ' INNER JOIN University AS U ON U.UniversityID=E.UniversityID AND U.UniversityName='universityname ' WHERE Title='title' AND ThesisNo =123 AND [Type]='type' AND [Language]=' Language' AND [SubmitDate] BETWEEN 2000 AND 2021 

But if there are empty fields. What should I do. Should i write code for every probability

o' Search Enstitute Supervisor Name University Author Name Subject Thesis No Thesis Type Thesis Name Language SEARCH Year

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!