6
Answers

My own problem

Photo of Asp.Net Hein

Asp.Net Hein

9y
457
1
My own problem 
 
- I have the table (course) and the another(training).
In course table- id no, coursecode, .....
In training table - idno,  name , nationality, ......
 
I want to retrieve the number(count) of coursecode which is in same id no and the nationality will be "American".
The number of coursecode should be less than 2. 
I want to implement this by LINQ statement.
 
If you want to help me, kindly help me. Thanks a lot :-)
 

Answers (6)

0
Photo of Asp.Net Hein
NA 266 61.6k 9y
The number of coursecode should be less than 2. This is the main part that I have problem. Not the retrieving part. I cannot check (less than). (<) is cannot use in joining tables.
0
Photo of Bhushan Bhasme
NA 948 135k 9y
var dealercontacts = from course in Course
    join Tr
in Training on course.IdNo equals Tr.IDNo
                     where tr.Nationality='American'
                    
select count(*);
Hope This Might Help You
         
 
            
0
Photo of Asp.Net Hein
NA 266 61.6k 9y
In Course Table
-Idno.
-Coursecode
and other information
 
In training table
-Idno.
-name
-Nationality
and other information 
 
Other infomation is not important to retrieve........ 
0
Photo of Upendra Pratap Shahi
NA 13.3k 861.7k 9y
Kindly give a snapshot of table structure..
0
Photo of Bhushan Bhasme
NA 948 135k 9y
Can You please give your table structure in details?
-1
Photo of Sakthikumar Thanavel
NA 1.2k 99.7k 9y
select idno,count(idno) from trainningtable where nationality='american' group by idno