views:

61

answers:

1

I used this brilliant solution to convert a linq query to a datatable. But I'm getting a strange error when running it. Build succeeds though.

Compiler Error Message: CS0121: The call is ambiguous between the following methods or properties:
'Gruppkoll.App_Code.ConvertToDataTableFromLinqResult.ToADOTable<Gruppkoll.MessageSet
    (System.Collections.Generic.IEnumerable<Gruppkoll.MessageSet>)' and
'Gruppkoll.App_Code.ConvertToDataTableFromLinqResult.ToADOTable<Gruppkoll.MessageSet
    (System.Collections.Generic.IEnumerable<Gruppkoll.MessageSet>)'

I've tried re-building it and restarting the IIS. It seems as there are two classes with the same method but I've checked this and that's not the case.

Any ideas? I'm using .NET 4.0 ASP.NET Webforms

+1  A: 

I solved it by moving the class outside of the App_Code directory. Explanation of why can be found here: http://stackoverflow.com/questions/1282636/the-call-is-ambiguous-between-the-following-methods-or-properties-bug

Phil