Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i have a database with the following details:

SCHOOL CAMPUS ADMINNO MODULECODE MODULEGRP
SEG AMK 100810R EG3932 EG3932-G1
SEG AMK 100810R EG3933 EG3933-G1
SEG AMK 101427Y EG3901 EG3901-G1
SEG AMK 101427Y EG3902 EG3902-G1
SEG AMK 101427Y EGS650 EGS650-G1
SEG AMK 103852S EG3901 EG3901-G1
SEG AMK 103852S EG3904 EG3904-G1

<only part="" of="" data="">

now i managed to get distinct students(adminno), modulecode(subject) populate in a datagrid
also, module-students in dgv which looks like:

EG1001 ---- Student 1
----------- Student 2
----------- Student 3

EG1002 ---- Student 2
----------- Student 4

But now i want to achieve:

Modulecode --- ModuleGrp ---- numberofstudents ---- students adminno
EG3932 ------- G1 ----------- 58 ------------------ 111411H 11253U 178292I...

Can anyone advice how can i go about achieving this?
Listview? or multi Line textbox? or other choices?

using vb.net, SQL commands with OleDB to retrieve data.
Thanks in advance!
Posted
Comments
bhuvamehul 15-Jul-13 8:36am    
Provide some your code so we can get more idea.
12345_abcde 15-Jul-13 8:50am    
''Connections
Dim connect As String
connect = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & Application.StartupPath & "\segdata.accdb"
Dim conn As New OleDbConnection(connect)
Dim cmd As OleDbCommand = New OleDbCommand
cmd.Connection = conn



conn.Open()
cmd.CommandText = "SELECT DISTINCT ModuleCode, AdminNo FROM(SEGDATA)ORDER BY ModuleCode ASC, AdminNo ASC"

Dim dt As New DataTable
dt.Load(cmd.ExecuteReader)

With dgvModStud
.AutoGenerateColumns = True
.DataSource = dt

End With

Dim currentModuleCode As String = String.Empty

For i = 0 To dgvModStud.Rows.Count - 1

If dgvModStud.Rows(i).Cells(0).Value = currentModuleCode Then

dgvModStud.Rows(i).Cells(0).Value = String.Empty
Else
currentModuleCode = dgvModStud.Rows(i).Cells(0).Value

End If



Next i


this is the code i used to achieve:


EG1001 ---- Student 1
----------- Student 2
----------- Student 3

EG1002 ---- Student 2
----------- Student 4
in datagridview.

but i want to achieve:

Modulecode --- ModuleGrp ---- numberofstudents ---- students adminno
EG3932 ------- G1 ----------- 58 ------------------ 111411H 11253U 178292I...

i dont know which display tools should i use, and how should i go about coding it.
im really in a rush for this, and i cant get any help, would really appreciate if you would help me out wit this.

should i do it with listview? datagridview which i think kinda not suitable? or multi line textbox or any other forms?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900