I get user name from a list box, I split the first name and lastname and with that I use that to find their userid from DB,
string FirstName = li.Value.Split(' ')[0].Trim();
string lastName = li.Value.Split(' ')[1].Trim();
But the tricky part here for me is when the user name is Mark Van Harm Jiti
the firstname is Mark Van and Surname is Harm Jiti. But my code takes Mark as first name and Van as surname. But I wont know which is first name and which is surname. I just get the text Mark Van Harm Jiti from the list box,. How should I change my query so that I get the User id for the user Mark Van Harm Jiti
string getuserid = "SELECT UserID from tbl_User Where FirstName=@FirstName AND LastName=@LastName";
I am using Mysql DB and it is c# code.