English 中文(简体)
加入3个表格,返回
原标题:joining 3 table and return

I have 3 table which are Timetable, 表格 and Consultation slot and i wish to combine them so that all the data are able to retrieve easily

时间表

1. TimetableID
2. Lecture ID
3. ClassVenue
4. ClassStartTime
5. ClassEndTime

表格

1. 表格ID
2. LectureID
3. 表格Venue
4. 表格StartTime
5. 表格EndTime

磋商时间

1. ConsultationID
2. LectureID
3. StudentID
4. 表格ID
5. remark

Here is my code in metadata

Partial Public Class CombinationOfTSC
    <Key()> _
    Public Property LectureID() As String
        Get
            Return m_LectureID
        End Get
        Set(value As String)
            m_LectureID = value
        End Set
    End Property
    Private m_LectureID As String

    Public Property StudentID() As String
        Get
            Return m_StudentID
        End Get
        Set(value As String)
            m_StudentID = value
        End Set
    End Property
    Private m_StudentID As String

    Public Property ttID() As String
        Get
            Return m_ttID
        End Get
        Set(value As String)
            m_ttID = value
        End Set
    End Property
    Private m_ttID As String

    Public Property ttClassVenue() As String
        Get
            Return m_ttClassVenue
        End Get
        Set(value As String)
            m_ttClassVenue = value
        End Set
    End Property
    Private m_ttClassVenue As String

    Public Property ttClassStartTime() As DateTime
        Get
            Return m_ttClassStartTime
        End Get
        Set(value As DateTime)
            m_ttClassStartTime = value
        End Set
    End Property
    Private m_ttClassStartTime As DateTime

    Public Property ttClassEndTime() As DateTime
        Get
            Return m_ttClassEndTime
        End Get
        Set(value As DateTime)
            m_ttClassEndTime = value
        End Set
    End Property
    Private m_ttClassEndTime As DateTime

    Public Property scID() As String
        Get
            Return m_scID
        End Get
        Set(value As String)
            m_scID = value
        End Set
    End Property
    Private m_scID As String

    Public Property scVenue() As String
        Get
            Return m_scVenue
        End Get
        Set(value As String)
            m_scVenue = value
        End Set
    End Property
    Private m_scVenue As String

    Public Property scStartTime() As DateTime
        Get
            Return m_scStartTime
        End Get
        Set(value As DateTime)
            m_scStartTime = value
        End Set
    End Property
    Private m_scStartTime As DateTime

    Public Property scEndTime() As DateTime
        Get
            Return m_scEndTime
        End Get
        Set(value As DateTime)
            m_scEndTime = value
        End Set
    End Property
    Private m_scEndTime As DateTime

    Public Property cID() As String
        Get
            Return m_cID
        End Get
        Set(value As String)
            m_cID = value
        End Set
    End Property
    Private m_cID As String

    Public Property cRemark() As String
        Get
            Return m_cRemark
        End Get
        Set(value As String)
            m_cRemark = value
        End Set
    End Property
    Private m_cRemark As String
End Class

在我的领域类别中,该守则将成为法典。

Public Function GetCoTSC(lectureID As String) As IQueryable(Of CombinationOfTSC)
        Dim CSC As IQueryable(Of CombinationOfTSC) = From c In ObjectContext.ConsultationSlots Join s In ObjectContext.表格s On c.表格ID Equals s.表格ID Join t In ObjectContext.TimeTables On t.LectureID Equals s.LectureID Where c.LectureID = s.LectureID = t.LectureID Select New CombinationOfTSC() With { _
                      .cID = c.ConsultationID, _
            .cRemark = c.Remark, _
            .StudentID = c.StudentID, _
             .LectureID = s.LectureID, _
            .scStartTime = s.表格StartTime, _
            .scEndTime = s.表格EndTime, _
            .scID = s.表格ID, _
            .scVenue = s.表格Venue, _
              .ttID = t.TimeTableID, _
              .ttClassVenue = t.ClassVenue, _
              .ttClassStartTime = t.ClassStartTime, _
            .ttClassEndTime = t.ClassEndTime}
        Return CSC
    End Function

I m having error at c.LectureID = s.LectureID = t.LectureID I wish to get the combination of 3 tables through the lectureID since there are lecture ID on 3 tables. Anyone helps pls.

问题回答

我不相信你能够有X=y=z。 你们是否试图把他们 se为奶牛?

,代替 c.LectureID = s.LectureID = t.LectureID





相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签