I have never used Linq-to-Sql before in an application, but I used LinqPad to develop a query and just wanted to insert it into my code.
It's not so easy. I figured out what I needed DataContextto handle the connection, but I still get errors because the view names are not recognized.
Should I use the constructor and create all View / Table classes? Is there an easier way?
This is a request. No updates are needed - just this request ....
var q = from user in V020
join userapp in V010 on user.SPP_USER_ID equals userapp.SPP_USER_ID
join app in V030 on userapp.SPP_AW_ID equals app.SPP_AW_ID
join tx in V040 on app.SPP_AW_ID equals tx.SPP_AW_ID
join appber in V070 on app.SPP_AW_ID equals appber.SPP_AW_ID
join ber in V050 on appber.SPP_AW_BEREICH_ID equals ber.SPP_AW_BEREICH_ID
where app.SPP_AW_AKTIV && user.SPP_USER_ID == "userid" && tx.SPP_AW_SPR == "de" && ber.SPP_AW_SPR == "de"
orderby ber.SPP_BER_SORTNB
select new {
AppName = app.SPP_AW_KURZBEZ, Url = tx.SPP_AW_URL, Label = tx.SPP_AW_NAME, Description = tx.SPP_AW_BESCHR,
Bereich = ber.SPP_AW_BERNAME,
Owner = app.SPP_AW_VERANTW, Remote = app.SPP_AW_REMOTE
}
;
source
share