How to search item in Ilist and hence display the output?
<p>How can i search the client name from the Ilist by using ClientID. i am unable to figure it out.I have created a simple class named clientdetails and made a connection with a oracle database .Now i simply want to search the list by using ClientID and hence display the result.</p>

<p>Thanks AK.</p>

<pre><code>class ClientDetails
{
    public string ClientID;
    public string ClientName;
    public string CreatedBy;
    public string UpdatedBy;

    public ClientDetails(string ClientID, string ClientName, string CreatedBy, string UpdatedBy)
    {
        this.ClientID = ClientID;
        this.ClientName = ClientName;
        this.CreatedBy = CreatedBy;
        this.UpdatedBy = UpdatedBy;
    }
}
class ConnectionSample
{
    static void Main()
    {
        OracleConnection con = new OracleConnection();

        //using connection string to connect to oracle database
        IList&lt;ClientDetails&gt; myfield = new List&lt;ClientDetails&gt;();
        try
        {

            con.ConnectionString = "xxxxxconnection stringxxxxx";
            con.Open();
            OracleCommand command = con.CreateCommand();
            string abc = "SELECT * FROM CLI_CLIENT_900";
            command.CommandText = abc;
            OracleDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                myfield.Add(new ClientDetails(reader["CLIENT_ID"].ToString(), reader["CLIENT_NAME"].ToString(), reader["CREATED_BY"].ToString(), reader["UPDATED_BY"].ToString()));

            }

        }
        catch (Exception ex)
        {
            Console.WriteLine("Error" + ex, "Error");
        }
        //close and dispose oracleconnection object

        con.Close();
        con.Dispose();

        foreach (ClientDetails c1 in myfield.OrderByDescending(s =&gt; s.ClientID))
        {

            Console.Write("\n" + c1.ClientID);
            Console.Write("\t"+c1.ClientName);
            Console.Write("\t\t"+c1.UpdatedBy);
        }
    }
    static void Display(IList&lt;string&gt; myfield)
    {
        foreach (string value in myfield)
        {
            Console.WriteLine("\t"+value);
        }
    }
</code></pre>
