本文介绍了将Sql转换为linq到sql ..........的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为下面的SQL查询编写linq to sql查询.
how to write a linq to sql query for the below sql query.
SELECT distinct lkpGeoCountry.countryName,lkpGeoLanguage.languageName
FROM dbo.lkpxrfGeoCountryLanguageTactic
INNER JOIN lkpGeoCountry
ON dbo.lkpxrfGeoCountryLanguageTactic.countryID =lkpGeoCountry.countryID
INNER JOIN lkpGeoLanguage
ON lkpxrfGeoCountryLanguageTactic.languageID=lkpGeoLanguage.languageID
推荐答案
YourDataContext dc = new YourDataContext();
var languages = dc.lkpxrfGeoCountryLanguageTactics.lkpGeoCountries.Select(c=>c.lkpGeoLanguage.languageName).Distinct();
干杯.
Cheers.
这篇关于将Sql转换为linq到sql ..........的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!