When the school teacher login into system, the teacher can only look thier student information in gridview and can do a few task such as edit the information make a disipline report and etc,.
i already created another webform which call AllStudent.aspx and in these webform will display all student information in gridview that not exist in Listedstudent.aspx,
the problem is the when i click the AllStudent.aspx the gridview data not appear student information need help
this is my query in sqldatasource
SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar] where Not Exists (SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar] where ([Kelas] = @Kelas))
the problem is the when i click the AllStudent.aspx the gridview data not appear student information need help
Hello,
afastars
SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar] where Not Exists (SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar] where ([Kelas] = @Kelas))
Are you sure that if you run this script of SQL, you can really fetch the proper records from the database?
I know your meaning, now I wanna know more about your data schema——So how do you design your table's schedules?What's the realtionship between these tables?
afastars
Member
52 Points
221 Posts
Do Not Want To Display Selected User In GridView
Nov 08, 2012 06:22 AM|LINK
hi all expertise
Need help the scenario as below:
When the school teacher login into system, the teacher can only look thier student information in gridview and can do a few task such as edit the information make a disipline report and etc,.
i already created another webform which call AllStudent.aspx and in these webform will display all student information in gridview that not exist in Listedstudent.aspx, the problem is the when i click the AllStudent.aspx the gridview data not appear student information need help
this is my query in sqldatasource
SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar] where Not Exists (SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar] where ([Kelas] = @Kelas))
really need help from expertise here
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Do Not Want To Display Selected User In GridView
Nov 09, 2012 12:32 AM|LINK
Hello,
Are you sure that if you run this script of SQL, you can really fetch the proper records from the database?
I suggest you checking that.
Reguards!
afastars
Member
52 Points
221 Posts
Re: Do Not Want To Display Selected User In GridView
Nov 09, 2012 03:31 AM|LINK
hi decker
i explain in more clear
like this..when the teacher want to log in system they need to full fill username and password and also select the class that they conduct
after that they can go to ListedStudent.aspx page to see all student information that belong to thier class (display in gridview)
then they also can go to AllStudent.aspx to see all student that did not belong to thier claseses
so i don't know either my query correct or not..please help me...really new in this concept
for your information i'm using session, when the user success log in into system the session will start
i also try these query below but still no luck so far
SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar] where Not Exists (SELECT [Kelas] FROM [MaklumatPelajar] where ([Kelas] = @Kelas))
when i run this query no data was display in gridview
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Do Not Want To Display Selected User In GridView
Nov 09, 2012 04:33 AM|LINK
Hi,
I know your meaning, now I wanna know more about your data schema——So how do you design your table's schedules?What's the realtionship between these tables?
afastars
Member
52 Points
221 Posts
Re: Do Not Want To Display Selected User In GridView
Nov 09, 2012 04:37 AM|LINK
the relatationship is 1 To many, from Teacher Table to Student Table
already do a lot's of thing need help decker
afastars
Member
52 Points
221 Posts
Re: Do Not Want To Display Selected User In GridView
Nov 09, 2012 06:55 AM|LINK
hi decker
i resolve the problem
below is the query
New Query
SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar]
where Not Exists (Select [Kelas] FROM [MaklumatGuru] where [Kelas] = @Kelas)
Old Query
SELECT [IdPelajar], [NoIc], [Nama],[Kelas] FROM [MaklumatPelajar]
where Not Exists (Select [Kelas] FROM [MaklumatGuru] where [Kelas] = @Kelas)
on the query above change the MaklumatPelajar to MaklumatGuru, because the relationship 1 to many from MaklumatGuru To MaklumatPelajar
now it work find....