Author: prontonet | Posted on: 10/12/2010 6:23:36 AM | Views : 251

hi,
I have a datalist binded to an object data source which has a method
GetLanguageByPersonId. 
 
In the  data list Item template, I have put  a div with a heading that will not show if there is no language by that personId  in the database table.
If there  is data them problem is the datalist repeates the heading for each language instead of showing  just the heading above and the row of languages below. I have included all my code below if somebody could advise what is wrong. thank you.
 
Method in DAL
SELECT        PersonId, LanguageId,
 (SELECT LanguageName FROM Language WHERE (LanguageId = PersonLanguage.LanguageId)) AS LanguageName
FROM            PersonLanguage
WHERE        (PersonId = @PersonId)
 

Go to the complete details ...