I have this Query and I want to extract the info generated and print them out in a ASP.net page that contain WML Card.
string queryString = "select st.firstname + ' ' + st.lastname,se.year, c.coursename,c.NumberOfCredits,ri.mark from Students st inner join RegisteredIn ri on ri.StudentId=st.id inner join Semester se on se.id=ri.SemesterId inner join Courses c on c.id=se.id ";
Note : the results will be somthing like
First Semester 2010
Student : Arin Rizk
Course Name No. of Credit Mark
AAA 3 65
BBB 3 23
CCC 3 65
DDD 3 58
EEE 3 70
How can I do it ? please show me.
You could build a model to represent your data:
then you could create a method that will query your database using ADO.NET and fill a collection of this model:
and finally you could bind this to a GridView in the page:
and in your code behind you will have the grid:
or if you don’t want to use a Grid view, simply use a
Repeaterand build whatever markup you like from the model.