加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

vb.net Linq四表查询

发布时间:2020-12-17 08:10:49 所属栏目:百科 来源:网络整理
导读:Using MainDepthSelDataBinding As New DataClasses1DataContext("Data Source=PC2013030515PKF;Initial Catalog=song;Integrated Security=True") Dim A1 = From cust In MainDepthSelDataBinding.MainN Dim Count As New List(Of AA) From {} For Each x I
Using MainDepthSelDataBinding As New DataClasses1DataContext("Data Source=PC2013030515PKF;Initial Catalog=song;Integrated Security=True")
            Dim A1 = From cust In MainDepthSelDataBinding.MainN
            Dim Count As New List(Of AA) From {}
            For Each x In A1
                Dim TempX = x
                Dim S1 = From cust In MainDepthSelDataBinding.Sec Where cust.secondNo1 = TempX.MainNo1
                Dim S2 = From cust In MainDepthSelDataBinding.Four Where cust.fourNo1 = TempX.MainNo3
                Dim S3 = From cust In MainDepthSelDataBinding.Third Where cust.thirdNo1 = TempX.MainNo2
                Dim A2 As New AA
                A2.No = TempX.id
                If S1.Any Then
                    A2.SX = S1.First.secondNo2
                End If

                If S2.Any Then
                    A2.YW = S2.First.fourNo2
                End If

                If S3.Any Then
                    A2.YY = S3.First.thirdNo2
                End If

                Count.Add(A2)
            Next

            DataGridView1.DataSource = Count


        End Using



Partial Class AA
    Property show1 As Integer = 0
    Property show2 As String = String.Empty
    Property show3 As String = String.Empty
    Property show4 As String = String.Empty
End Class

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读