Linq Translation Failed

4 posts, 0 answers
  1. Hardy Wang
    Hardy Wang avatar
    40 posts
    Member since:
    Jan 2003

    Posted 18 Nov 2011 Link to this post

    I tried C# to VB.NET translation with Linq code, so far I have no seen any success yet.
  2. Todd
    Todd avatar
    66 posts

    Posted 21 Nov 2011 Link to this post

    Hello Hardy Wang,

    Sorry for the trouble converting your LINQ code. Currently, the Code Converter does not well handle LINQ, though we hope it will improve in the future (with improvements to the underlying NRefactory open source engine). For most other C#/VB, the Code Converter should be able to help you convert between the syntaxes.

    If you'd like , you can share an example of the LINQ you're trying to convert and we'll use that as reference test for future engine improvements.


  3. Bruce
    Bruce avatar
    8 posts
    Member since:
    Jan 2008

    Posted 25 May 2012 Link to this post

    Here is one example:

    var distinctNames = ( from row in DataTable.AsEnumerable() select row.Field<string>("Name")).Distinct();

    (var name in distinctNames )
    { Console.WriteLine(name); }
  4. Todd
    Todd avatar
    66 posts

    Posted 23 Jul 2012 Link to this post

    Thanks, Bruce!

    We'll use that as an example as we readdress the underlying conversion engine in the converter. In the meantime, don't miss Telerik's JustDecompile, which has support for both VB and C#. If you have a lot of compiled C# code, JustDecompile could help you translate it to VB, too.

Back to Top