TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sthe Dladla
NA
1
1.2k
Taking specific list from database table using mvc4 razor
Jun 19 2013 7:31 AM
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;
}
}
}
Reply
Answers (
0
)
MDI Parent child forms
Null reference exception