Error generating report: <Column> and <Column> have conflicting properties: incompatible Datatype property

Asked

Viewed 201 times

0

When trying to fill a datatable dynamically the error occurs when performing a merge of the other data.

            For Each drw In dtbTemp.Rows
                dtb = obj.Enquadra(drw.Item("IDCON_TMP"), drw.Item("IDCAR_TMP"))
                dtb.Columns.Add("IDCON_CON", GetType(Integer))
                For Each drwTit In dtb.Rows
                    drwTit.Item("IDCON_CON") = drw.Item("IDCON_TMP")
                Next
                dtb.TableName = "Titulo"
                If dst.Tables.IndexOf(dtb.TableName) > -1 Then
                    dst.Merge(dtb)
                Else
                    dst.Tables.Add(dtb)
                End If
                dtb = New DataTable
            Next

The following error is thrown:

Erro ao gerar o relatório: <Coluna> e <Coluna> têm propriedades conflitantes: propriedade DataType incompatível.

I’m taking all records from the temporary datatable and treating each row and inserting into a new datatable.

1 answer

0

Use Missingschemaaction.Ignore as parameter in the Dataset Merge. This parameter specifies the action to be taken when adding data to the Dataset and the Datatable or Datacolumn is missing. The Ignore ignore extra or conflicting columns.

The code section should look like this:

dst.Merge(dtb, True, MissingSchemaAction.Ignore)

True is for preserving changes in Datatable.

Source: Documentation in msdn.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.