Fangling 0 Light Poster

i have a database table containing:

SEG,AMK,101427Y,EG3902,EG3902-G1
SEG,AMK,101427Y,EGS650,EGS650-G1
SEG,AMK,103852S,EG3901,EG3901-G1
SEG,AMK,103852S,EG3904,EG3904-G1
SEG,AMK,103852S,EGS104,EGS104-G1
SEG,AMK,103852S,EGS650,EGS650-G1
SEG,AMK,106581C,EG3901,EG3901-G1
SEG,AMK,106581C,EG3902,EG3902-G1
SEG,AMK,111713M,EG3901,EG3901-G1
SEG,AMK,111713M,EG3902,EG3902-G1

another table containing:

1   SEG-AMK EG1832  Mechanics and Materials         286 1.5 EG1832                          
2   SEG-AMK EG1833  Electrical Principles           375     1.5 EG1833  EG1952  EG1903                  
3   SEG-AMK EG1835.1 Engineering Mathematics (1)    456 1.5 EG1835  EG1001                      
4   SEG-AMK EG1835.2 Engineering Mathematics (2)    363 1.5 EG1907  EG1681  EG1951  

i want to search for common students within exampapers
result:

example: if student 111411H is taking EG1832 in paper 1 and EG1952 in paper 2,

then:

Conflicting paper   Numofstudents   AdminNo
paper1 : paper2      1               111411H . . . 

How to do i it?

my codes so far:

Dim dbprovider As String
    Dim dbsource As String
    Dim dspaperslist, dsmodulestudents As New DataSet
    Dim daPaperlist, daSegdata As OleDb.OleDbDataAdapter
    Dim con As New OleDb.OleDbConnection
    Dim paperslist As String
    Dim segdata As String

    dbprovider = "PROVIDER=Microsoft.Ace.OLEDB.12.0;"
    dbsource = "Data Source =" & Application.StartupPath & "\segdata.accdb"
    con.ConnectionString = dbprovider & dbsource


    con.Open()
    paperslist = "SELECT * FROM paperslist"
    daPaperlist = New OleDb.OleDbDataAdapter(paperslist, con)
    daPaperlist.Fill(dspaperslist, "paperslist")

    segdata = "SELECT * FROM ModuleStudents"
    daSegdata = New OleDb.OleDbDataAdapter(segdata, con)
    daSegdata.Fill(dsmodulestudents, "ModuleStudents")

    ''check if dataset has records
    'If dsmodulestudents.Tables(0).Rows.Count = 0 Then

    'MessageBox.Show("no records")

    ' Else

    'MessageBox.Show("records found")

    'End If

    For i As Integer = 0 To dspaperslist.Tables(0).Rows.Count - 1
        Dim found As Boolean = False
        Dim adminno As String
        For j As Integer = 0 To dsmodulestudents.Tables(0).Rows.Count - 1

        Next
    Next
    con.Close()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.