I should have spotted this before. You are creating a DataTable and adding it to a DataSet, variable named "ds". Then you are trying to add the same DataTable to another DataSet, variable named "ds1". Thus, the error message.
Does the MySqlDataAdapter have a Fill method variation that accepts a DataTable as a parameter instead of a DataSet? I know that the DbDataAdapter abstract class has such a method.
Otherwise, rearrange all of your logic to fill a single DataSet with the two DataTable objects, then set your relationship item within that. It might look something like this (assuming I can read VB correctly, being a C# developer!!) :
__________
Dim dataSet1 As New DataSet
Dim masterdt As DataTable = ds.Tables.Add("Employee")
Dim detaildt As DataTable = ds.Tables.Add("Dependent")
Dim str As String
Dim da As MySqlDataAdapter
str = "SELECT EmployeeID, EmployeeName FROM tblemployee"
da = New MySqlDataAdapter(str, Connection.conn)
Open()
da.Fill(dataSet1, "Employee")
Close()
str = "SELECT DependentID, DependentName FROM tbldependent"
da = New MySqlDataAdapter(str, Connection.conn)
Open()
da.Fill(dataSet1, "Dependent")
Close()
' The following is almost right. Did not fetch EmployeeID from tbldependent,
' and do not know what the relationship should actually be.
dataSet1.Relations.Add("Details", masterdt.Columns("EmployeeID"), detaildt.Columns("EmployeeID"))
Dim dvm As DataViewManager = New DataViewManager(dataSet1)
Dim dv As DataView = dvm.CreateDataView(masterdt)
GridControl1.DataSource = dv
__________
I hope that helps.