如何绑定到网格视图 [英] how to bind to grid views
问题描述
我使用两个网格视图,一个用于课程,另一个用于学生..
所以,
gridview1显示课程..另一个学生gridview必须显示学生的详细信息
i'm using two gridviews one is for courses and other one is for students..
so,
gridview1 shows courses .. and another students gridview must show the details of the student
courses (course_id(101),title(asp.net),amount(5000))
student (student_id(01)),name(santosh),joining(22/12/2012)..)
本课程平行显示学生在其他gridview ..
this course parallely show the student in other gridview..
推荐答案
使用数据集从数据库中获取数据并将其绑定到gridview。
Get your data from the database using the dataset and bind it to your gridview.
Gridview1.DataSource=ds;
Gridview1.DataBind();
这里是Gridview的示例列表参考这个
http ://asp-net-example.blogspot.in/2008/10/gridview-example-how-to-use-gridview-in.html [ ^ ]
http://www.aspdotnet-suresh.com/ 2012/05 / aspnet-gridview-examples-and-samples-in.html [ ^ ]
和在第二个fridview中显示CourseId意味着使用连接绑定存储过程中的课程ID,因为学生必须包含CourseId来指导student当然,正确的名称。
请参阅此表以加入表格。
http://www.w3schools.com/sql/sql_join.asp [ ^ ]
希望有所帮助。
here is the list of examples for Gridview refer this
http://asp-net-example.blogspot.in/2008/10/gridview-example-how-to-use-gridview-in.html[^]
http://www.aspdotnet-suresh.com/2012/05/aspnet-gridview-examples-and-samples-in.html[^]
and to show the CourseId in second fridview means bind the course id in the stored procedure using joins because the student must contain the CourseId to mentin the student course name, right.
Refer this for joining the table.
http://www.w3schools.com/sql/sql_join.asp[^]
Hope it helps.
这篇关于如何绑定到网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!