I've got some pages that use linq to sql. When I look at the
generated sql statements in sql server profiler, I see the same
statements repeated. In the example below (from a linq data source
selected statement), the same sql query is run against the database 3
times at:
oStudent.Count
oStudent(0).lkp status.students tatus
oStudent(0).lkp status.statusca tegory
Is this the expected behavior? I expected the select to be run only
once. Thanks in advance for help with this.
Private Sub lds_Student_Sel ected(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Linq DataSourceStatu sEventArgs) Handles
lds_Student.Sel ected
Dim oStudent As List(Of personal) = CType(e.Result, List(Of
personal))
If oStudent.Count = 1 Then
Session("Curren tStudentStatus" ) =
oStudent(0).lkp status.students tatus
Session("Curren tStudentStatusC ategory") =
oStudent(0).lkp status.statusca tegory
End If
End Sub
Jim
generated sql statements in sql server profiler, I see the same
statements repeated. In the example below (from a linq data source
selected statement), the same sql query is run against the database 3
times at:
oStudent.Count
oStudent(0).lkp status.students tatus
oStudent(0).lkp status.statusca tegory
Is this the expected behavior? I expected the select to be run only
once. Thanks in advance for help with this.
Private Sub lds_Student_Sel ected(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Linq DataSourceStatu sEventArgs) Handles
lds_Student.Sel ected
Dim oStudent As List(Of personal) = CType(e.Result, List(Of
personal))
If oStudent.Count = 1 Then
Session("Curren tStudentStatus" ) =
oStudent(0).lkp status.students tatus
Session("Curren tStudentStatusC ategory") =
oStudent(0).lkp status.statusca tegory
End If
End Sub
Jim
Comment