Option Strict On disallows implicit conversions from ‘Object’ to ‘System.Data.DataTable’

I am using a for each loop, yet it shows the error message as “Option Strict On disallows implicit conversions from ‘Object’ to ‘System.Data.DataTable’”

Kindly find the screenshot attached.

Thanks in Advance. Kindly help.

Try output data table
as currentitem.tostring
as it takes only string

@Veeresh_uppin

Instead of using for each you simply type Dataset.Tables(0) in output datatable

Hello @Veeresh_uppin ,

Please check the properties of the for each loop. And make sure the type argument in the properties pane is set to Datatable not object.

Hi,

Can you try to set DataSet.Tables.Cast(Of DataTable) as the following?

image

If you use Windows-Legacy, it’s also good to set DataTable at TypeArgument property.

Regards,

1 Like

Hi @Veeresh_uppin

try to change the Type of Argument for for each to datatable

hope this helps

Hello @Veeresh_uppin ,
Could You please let me Know What are you trying to do or What is the Expected Output?
Regards