StudentTimeTable s = new StudentTimeTable();
var stu = from d in db.Students
where d.SubjectID == txtSubID.Text.Trim() && d.Section == txtSec.Text.Trim()
select d;
foreach (var d in stu)
{
s.StudentID = d.StudentID;
s.SubjectID = txtSubID.Text.Trim();
s.Section = txtSec.Text.Trim();
s.DateExam = CalendarExam.SelectedDate.Date;Code (C#)
s.timeStart = DropTimeStart.SelectedValue.Trim();
s.timStop = DropTimeStop.SelectedValue.Trim();
db.StudentTimeTables.InsertOnSubmit(s);
}
db.SubmitChanges();
Tag : ASP.NET, Ms SQL Server 2008, Web (ASP.NET), C#