Getting compiler error on Type into option strict on disallows implicit conversions from ‘string’ to ‘long’

Hi,

I try to make a select from a datatable but I have an error.
I try to change the type of my String in GenericValue, but I have the same issue.

dtInJobData.Select(“[ID]<>‘’ " AND “[Heure de Contrôle]>='”+hourToCheckStart +”‘" AND "[Heure de Contrôle]<’“+hourToCheckEnd+”'").CopyToDataTable()
Thanks in advance

1 Like

Hi,

Can you try the following?

dataWeekJob = dtInJobData.AsEnumerable.Where(function(r) r("ID").toString<>"" and r("Heure de Controle").toString>=hourToCheckStart.toString and r("Heure de Controle").toString<hourToCheckEnd).CopyToDataTable

Or If you want to evaluate hourToCheckStar and hourToCheckEnd as not String but Numeric, the sentence will be the following.

dataWeekJob = dtInJobData.AsEnumerable.Where(function(r) r("ID").toString<>"" and Int64.Parse(r("Heure de Controle").toString)>=Int64.Parse(hourToCheckStart) and Int64.Parse(r("Heure de Controle").toString)<Int64.Parse(hourToCheckEnd)).CopyToDataTable

Regards,

2 Likes

Thanks a lot. I use the first solution. It’s working!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.