Typed Dataset Adding DataTable
Posted on 2005-04-26
I have an auto generated typed dataset from a Data > DataAdapter Control in VS.NET.
I have the need to create a datarow from the typed dataset with values that I collect in my application.
I am able to add the row to a typed datatable from the typed recordset but when it comes time to add the instance of the datatable to the recordset I get error: DataTable already exists in this DataSet.
I have managed to make this work by creating first just a generic DataSet and adding the typed DataTable to it as follows:
Dim ds As DataSet = New DataSet("dsCustomErrors")
Dim dt As New dsCustomErrors.CustomErrorsDataTable
Dim dr As dsCustomErrors.CustomErrorsRow = dt.NewCustomErrorsRow
dr.err_Msg = _exc.Message.ToString
dr.err_AppName = _values.ApplicationName
ds.DataSetName = _values.ApplicationName
Catch ex As Exception
But if I wanted to use the typed DataSet? How do I "merge" the DataTable back to the typed DataSet?