Hi
I have a page which have the list of student with their information included
( Student name , Student ID , Student level)
I want if I click on the name of each student open other page has the schedule of this student.
I want to know what is the technique that help me to transfer to specific schedule.
Because when I click on any student it gave me the same schedule for the whole list.
This is my code for the first page:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="FIRST_NAME_A" HeaderText="FIRST_NAME_A" visible="false"
SortExpression="FIRST_NAME_A" />
<asp:BoundField DataField="FATHER_NAME_A" HeaderText="FATHER_NAME_A" visible="false"
SortExpression="FATHER_NAME_A" />
<asp:BoundField DataField="FAMILY_NAME_A" HeaderText="FAMILY_NAME_A" visible="false"
SortExpression="FAMILY_NAME_A" />
<asp:BoundField DataField="CURRENT_LEVEL" HeaderText="Level"
SortExpression="CURRENT_LEVEL" />
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# string.Format("sch.aspx?ID={0}{1}{2}", Eval("FIRST_NAME_A"), Eval("FATHER_NAME_A"), Eval("FAMILY_NAME_A")) %>'
Target="_blank" Text='<%# Eval("FIRST_NAME_A") +""+ Eval("FATHER_NAME_A") +"" + Eval("FAMILY_NAME_A")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="STUDENT_NO" HeaderText="IDStudent"
SortExpression="STUDENT_NO" />
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# string.Format("sch.aspx?ID=", Eval("STUDENT_NO")) %>'
Target="_blank" Text='<%# Eval("STUDENT_NO")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
This code for the second page ( that I want the schedule appear on it)
protected void Button1_Click(object sender, EventArgs e)
{
string str = Request.QueryString["ID"];
string s = "301063";
String conStr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings…";
SqlConnection cn = new SqlConnection(conStr);
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT COURSE_DEPARTMENT,COURSE_NO,SECTION_NO FROM TSENROLL ";
cmd.CommandText += " INNER JOIN TSTUDENT ON TSENROLL.STUDENT_NO = TSTUDENT.STUDENT_NO WHERE TSENROLL.STSECTION_STUDENT_NO='1400'";
cn.Open();
SqlDataReader reader = cmd.ExecuteReader();
GridView1.DataSource = reader;
GridView1.DataBind();
cn.Close();
}
thanks for ur help