You are here:

VB.NET/Getting conflict data, comparing tables

Advertisement


Question
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:


Collapse | Copy Code
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:

Collapse | Copy Code
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()

Answer
I cant help you with the logic as this would require that I run your app and perform debugging. I can assist you if you are getting any errors in the code or if the results are not showing up as expected.

Please tell me what kind of output are you getting currently.

VB.NET

All Answers


Answers by Expert:


Ask Experts

Volunteer


Syed Rizwan Muhammad Rizvi

Expertise

I can answers questions regarding web based and desktop based programming in VB.Net. Which can include SOAP, XML, Custom Controls, COM Interoperability etc.

Experience

Have been working in this specific area for last 2 years previously I was a VB 6 Developer with experties in other languages as well. Total 10 years of programming experience.

©2016 About.com. All rights reserved.