i have dt1 from a query
cmd.CommandText = "SELECT DISTINCT AdminNo, ModuleCode FROM(SEGDATA)ORDER BY AdminNo ASC, ModuleCode ASC"
Dim dt1 As New DataTable
dt1.Load(cmd.ExecuteReader)
DataGridView1.AutoGenerateColumns = True
DataGridView1.DataSource = dt1
another query dt2
cmd.CommandText = "SELECT DISTINCT PaperNo,ModuleCode1,ModuleCode2,ModuleCode3, ModuleCode4, ModuleCode5, ModuleCode6, ModuleCode7, ModuleCode8, ModuleCode9 FROM(PapersList)ORDER BY PaperNo ASC"
Dim dt2 As New DataTable
dt2.Load(cmd.ExecuteReader)
DataGridView2.AutoGenerateColumns = True
DataGridView2.DataSource = dt2
dt1:
AdminNo ModuleCode
111411H EG1001
111411H Eg1003
111380Y EG2011
dt2:
PaperNo Module1 Module2 Module3 ....
1 EG1001
2 EG1003 EG1001
3 EG2011
How do i loop these 2 tables to get:
AdminNo PaperNo
111411H 1
111411H 2
111380Y 3
Anybody help me with the codes, thanks!