private string Construct_whereClause() { string retval = null; try { Vendor Vend = new Vendor(DataList.EpicConn); bool morePages; VendorListDataSet VendList = Vend.GetList("VendorID = '" + idnum_txt.Text + "'", 100, 0, out morePages); VendorID = VendList.Tables[0].Rows[0]["VendorNum"].ToString(); if (idnum_txt.Text != null && idnum_txt.Text != "") retval += "VendorNum = '" + VendorID + "'"; if (name_txt.Text != null && name_txt.Text != "") retval += " Name >= '" + name_txt.Text + "'"; retval += " BY NAME"; } catch { retval = " BY NAME"; } return retval; }