Hi Sneha,
You can use Linq to query your list of names.
Basic syntax on how you will do is explained below:
IList<string> numbers = new List<string>()
{
"one","two","three","four","five","six","seven","eight","nine","ten"
};
var filteredNumbers = numbers.Where(x => x.StartsWith("t")).Select(x => x.Length).ToList();
filteredNumbers.ForEach(x => Console.WriteLine(x));
So, you just have to fetch the names from the database and store those names in any Enumerable object like IList etc and query them with Linq on text change or whatever way you want.
Hope this help you.
Happy Coding :)