Typically I use a Dataset object and store a table in Session for RadGrid's datasource. I have been using Linq To Sql lately but I cannot figure out how to use Linq for the datasourse in Session for the RadGrid....for example, how would I convert the following code to using Linq?
To make it simple, lets assume this is the linq Query.
Dim query = From c in db.Case_Experts _
Select c.Id, c.Name
Also assume that I want to do updates/inserts/deletes to the data.
Appreciate any help, thank you.
Coty
Protected Sub radGridExperts_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles radGridExperts.NeedDataSource |
If Not IsNothing(Session("Experts")) Then |
radGridExperts.DataSource = CType(Session("Experts"), Case_Inquiry.Case_ExpertsDataTable) |
Else |
'do not fill anything, but create blank datasource |
Dim dt As New Case_Inquiry.Case_ExpertsDataTable |
Session("Experts") = dt |
radGridExperts.DataSource = dt |
End If |
End Sub |
To make it simple, lets assume this is the linq Query.
Dim query = From c in db.Case_Experts _
Select c.Id, c.Name
Also assume that I want to do updates/inserts/deletes to the data.
Appreciate any help, thank you.
Coty