Assign: Specified cast is not valid Error

Hi all,

I am try to split an excel sheet by “Sipariş No” column. It should create new excel sheets for each “Sipariş No” column element.

But i am getting “Specified cast is not valid” error when try to do that.

Here is my split code:
dt_distinct = dt_siparisler.AsEnumerable.GroupBy(function(x) x.field(of double)(“Sipariş No”)).select(function(g) g.FirstOrDefault).copytodatatable

@mazlumkacar Can you Check with this :
dt_distinct = dt_siparisler.AsEnumerable.GroupBy(function(x) x(“Sipariş No”).ToString).select(function(g) g.FirstOrDefault).copytodatatable

1 Like