I am new with mvc4 razor and I want to take a list names from the table, the code I tried only take one record. It overwrites the other records and take the last record.
here is the code Ive tried.
public DateTime sys { get; set; }
public int date { get; set; }
public string cellno { get; set; }
public string childs { get; set; }
public string vname { get; set; }
public string vsname { get; set; }
public string cname { get; set; }
public string csname { get; set; }
public string voluteer { get; set; }
public void Update()
{
Entities db = new Entities();
var dm = db.DomainAndScores.ToList();
DomainAndScore ds = new DomainAndScore();
sys = DateTime.Now;
string dates = Convert.ToString(sys);
string dd = dates.Substring(0, 2);
foreach (var i in dm)
{
cellno = i.Child.Volunteer.Volunteer_Cellphone_Number;
date =ds.Update_Date.Month;
childs = i.Child_UIN;
cname = i.Child.Child_First_Name;
csname = i.Child.Child_Last_Name;
vname = i.Child.Volunteer.Volunteer_Firstname;
vsname = i.Child.Volunteer.Volunteer_Surname;
}
}
}