I have two text boxes and one combobox. I am retrieving the data based upon the text entered into the text boxes and combobox selection, by using the following method:    private void textboxfillnames()    {          if (txtlastname.Text != )          {        var totalmembers = from tsgentity in eclipse.members                             join memtomships in eclipse.membertomships on tsgentity.member_Id equals memtomships.member_Id                             join mshipoptiions in eclipse.mshipoptions on memtomships.mshipOption_Id equals mshipoptiions.mshipOption_Id                             join mshiptypes in eclipse.mshiptypes on mshipoptiions.mshipType_Id equals mshiptypes.mshipType_Id                             join mshipstatus in eclipse.mshipstatustypes on memtomships.mshipStatusType_Id equals mshipstatus.mshipStatusType_Id                             where tsgentity.member_Lastname.StartsWith(txtlastname.Text)                             select new {                                 tsgentity.member_Id,                                 tsgentity.member_Lastname,                                 tsgentity.member_Firstname,                                 tsgentity.member_Postcode,                                 tsgentity.member_Reference,                                 tsgentity.member_CardNum,                                 tsgentity.member_IsBiometric,                                 tsgentity.member_Dob,                                 mshiptypes.mshipType_Name,                                 mshipstatus.mshipStatusType_Name,                                 memtomships.memberToMship_EndDate                                                                 };        dgvReportMembers.DataSource = totalmembers;    }    if (txtpostcode.Text != )    {        var totalmembers = from tsgentity in eclipse.members                          join memtomships in eclipse.membertomships on tsgentity.member_Id equals memtomships.member_Id                          join mshipoptiions in eclipse.mshipoptions on memtomships.mshipOption_Id equals mshipoptiions.mshipOption_Id                          join mshiptypes in eclipse.mshiptypes on mshipoptiions.mshipType_Id equals mshiptypes.mshipType_Id                          join mshipstatus in eclipse.mshipstatustypes on memtomships.mshipStatusType_Id equals mshipstatus.mshipStatusType_Id                          where tsgentity.member_Postcode.StartsWith(txtpostcode.Text)                          select new {                              tsgentity.member_Id,                              tsgentity.member_Lastname,                              tsgentity.member_Firstname,                              tsgentity.member_Postcode,                              tsgentity.member_Reference,                              tsgentity.member_CardNum,                              tsgentity.member_IsBiometric,                              tsgentity.member_Dob,                              mshiptypes.mshipType_Name,                              mshipstatus.mshipStatusType_Name,                              memtomships.memberToMship_EndDate                          };        dgvReportMembers.DataSource =  totalmembers;      }     if (cbGEStatustype.Text != null)    {          var totalmembers = from tsgentity in eclipse.members                           join memtomships in eclipse.membertomships on tsgentity.member_Id equals memtomships.member_Id                           join mshipoptiions in eclipse.mshipoptions on memtomships.mshipOption_Id equals mshipoptiions.mshipOption_Id                           join mshiptypes in eclipse.mshiptypes on mshipoptiions.mshipType_Id equals mshiptypes.mshipType_Id                           join mshipstatus in eclipse.mshipstatustypes on memtomships.mshipStatusType_Id equals mshipstatus.mshipStatusType_Id                           where mshipstatus.mshipStatusType_Name.StartsWith(cbGEStatustype.Text)                             select new {                               tsgentity.member_Id,                               tsgentity.member_Lastname,                               tsgentity.member_Firstname,                               tsgentity.member_Postcode,                               tsgentity.member_Reference,                               tsgentity.member_CardNum,                               tsgentity.member_IsBiometric,                               tsgentity.member_Dob,                               mshiptypes.mshipType_Name,                               mshipstatus.mshipStatusType_Name,                               memtomships.memberToMship_EndDate                            };        dgvReportMembers.DataSource = totalmembers;    }}
Retrieving data based upon text entered in a textbox
c#;.net;linq;winforms