Question: Ok, we are having issues with an algorithm that is becoming very database intensive. Our solution is that we are going to pre cache all the data into an ado.net dataset and query the dataset via linq.
We are going to cache all the data we need into the dataset with the exact same schema as it was in the database. Theoretically as long as we translate our linq queries to work exactly like our sql queries then the algorithm should behave exactly the same way. We feel this is going to minimize the rewrite effort.
Anyway here is my issue, we have a few complex queries in the algorithm and i am not sure how we would translate them to Linq. As a start if someone could give me an example on how i could simulate this same query via linq that would be great.
sql = "SELECT ProcKey, ProcDescr, ProcGap, ProcDuration, " & _
"ProcGapDuration, ProcFinishDuration, ProcResource FROM " & _
"Procedures WHERE ProcKey IN " & _
"(Select ServProc From ServFile WHERE ServAllowBookOnline = True) " & _
"AND ProcAllowBookOnline = -1 Order by ProcDescr"
'Lets assume that i have a dataset named dsServices and i fill it with the 'following two queries. Select * From ServFile, Select * From Procedures
' Now what i want to do is query the dataset with linq so that i am getting the same results as my original query.
' then i would like to convert it back to a datatable using the CopyToDataTable ' method
' Now that i have this table it will fit right back into the flow of my
' algorithm with minimal changes.
Examples would be appreciated.
thanks in advance