Quote:
'This handles the relationship between the two columns
Dim datarelation As DataRelation
Dim dc1 As DataColumn
Dim dc2 As DataColumn
'It's not important but gives your code more better way to compare strings between tables
DsProgram.CaseSensitive = True
'Now , we will fill the first table and add it to the dataset
DAProgram.TableMappings.Add("myTable", "Program")
DAProgram.Fill(DsProgram)
'As we did in the previous step , here for the Second table
ProfileDataAdapter.TableMappings.Add("myTable", "UserProfile")
ProfileDataAdapter.Fill(DsProfile)
dc1 = DsProgram.Tables("Program").Columns("PSerial")
dc2 = DsProgram.Tables("UserProfile").Columns("DPSerial")
'Here we combined two datacolumns to the relations obj
datarelation = New DataRelation("Tab1andTab2", dc1, dc2)
DsProgram.Relations.Add(datarelation)
'Simple one , bind the dataset after all operation to the Datagrid
dgComputer.DataSource = DsProgram.DefaultViewManager
'Show the first table in the grid because it's the primary table
dgComputer.DataMember = "PSerial"
And here's the error: