How about a custom class for the list items, and then just add one for each row retrieved from the database?
public class Employee
{
string Name { get; set; }
string UserID { get; set; }
string Address { get; set; }
string DBO { get; set; }
string Salary { get; set; }
}
Create your list
List<Employee> lstEmployees = new List<Employee>;
And then to add each item pop it in a loop (let's say it's in a DataTable
):
foreach (DataRow row in dt)
{
Employee e = new Employee();
e.Name = row["name"];
e.UserID = row["userid"];
e.Address = row["address"];
e.DBO = row["dbo"];
e.Salary = row["salary"];
lstEmployees.Add(e);
}