Try like this
string data = txtsearchusers.Text;
string[] s1 = data.Split();
string fName = null, sName = null;
fName = s1[0].ToString();
clsregisterinfo.FirstName = fName;
if (s1.Length == 2)
{
sName = s1[1].ToString();
clsregisterinfo.LastName = sName;
}
In the Query you can check the condition as
if Second name is null then ignore the condition(checking second name) in SQL Query. else check with the first name only....