Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 21, 2012 08:42 PM by GmGregori
Member
19 Points
25 Posts
Dec 21, 2012 02:52 PM|LINK
That got it. thanks!
Dec 21, 2012 04:39 PM|LINK
is it possible to make the names linkes? I tried this.
<tr> @foreach(var row in name1) { <td> @row.Student_Name<a href="~/ViewStudent_teacher?id=@item.ID"></td> } </tr>
Contributor
5438 Points
730 Posts
Dec 21, 2012 08:42 PM|LINK
If I have understood your purposes and if ID is a field of the Student_Information table, you should change your query as in the following
var name1 = db.Query(@"SELECT ID, Student_Name FROM Student_Information WHERE Date_Enrolled >'08/03/2012' ORDER BY Date_Enrolled ASC");
and use this code to display the links
<tr> @foreach(var row in name1) { <td><a href="~/ViewStudent_teacher?id=@row.ID">@row.Student_Name</a></td> } </tr>
Thrasher114
Member
19 Points
25 Posts
Re: Sorting Data by Date
Dec 21, 2012 02:52 PM|LINK
That got it. thanks!
Thrasher114
Member
19 Points
25 Posts
Re: Sorting Data by Date
Dec 21, 2012 04:39 PM|LINK
is it possible to make the names linkes? I tried this.
<tr> @foreach(var row in name1) { <td> @row.Student_Name<a href="~/ViewStudent_teacher?id=@item.ID"></td> } </tr>GmGregori
Contributor
5438 Points
730 Posts
Re: Sorting Data by Date
Dec 21, 2012 08:42 PM|LINK
If I have understood your purposes and if ID is a field of the Student_Information table, you should change your query as in the following
var name1 = db.Query(@"SELECT ID, Student_Name FROM Student_Information WHERE Date_Enrolled >'08/03/2012' ORDER BY Date_Enrolled ASC");and use this code to display the links
<tr> @foreach(var row in name1) { <td><a href="~/ViewStudent_teacher?id=@row.ID">@row.Student_Name</a></td> } </tr>