Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi.. Friends I have a table having two column course_Name and question_Name having
like
course_Name  question_Name 

ASP.Net     What is ASP .Net ?
ASP.Net     What is State Management ?
ASP.Net     What is Session ?
Java        Difference Between Java & ASP.net ?
Java        Is here multiple inheritance in Java ?

I wants to display result on my default.aspx page..
ASP.Net

What is ASP .Net ?
What is State Management ?
What is Session ?

Java   
   
Difference Between Java & ASP.net ?  
Is here multiple inheritance in Java ?

is anybody please help me how can I get this, using any control in asp.net.

Please help me.

Thanks & Regards
Parveen Rathi
Posted
Updated 9-Jan-12 20:04pm
v2
Comments
Sergey Alexandrovich Kryukov 9-Jan-12 0:58am    
"Difference between Java & ASP.net"? You will teach them, aha. :-)
This pseudo-education is already corrupted the system, fake "knowledge" and training are overwhelming...
--SA

If your page has only two course names you can use following two queries
SQL
SELECT question_Name FROM TableName WHERE course_Name="Asp.Net"
SELECT question_Name FROM TableName WHERE course_Name="Java"

otherwise you can use separate method to get following formatted output
C#
string[] s= (FROM TableName SELECT DISTINCT course_name);
//linq code for retrieve distinct courses
foreach(str in s){
getOutput(str);
}

C#
string getOutput(string course){ 
string output=course+"\n";
string[] s=(FROM TableName 
            WHERE course_Name=course
            SELECT question_Name);
foreach(str in s){
output+=str+"\n";
}
return output;
}

This is not exact code but hope you can get some idea from this...
 
Share this answer
 
check this Problem in sql query[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900