Unanswered Using in statement inside ADO.Net 2.0

  • Thursday, May 04, 2006 7:29 PM
     
     

    I am using this code to get rows from a datatable but it throws an exception

    (Cannot perform '=' operation on System.Guid and System.String)

    DataRow[] drows = dt.Select("RefID in('1e1cde8e-28b6-493d-b6ce-d1b81b69e83f','1e1cde8e-28b6-493d-b6ce-d1b81b69e83f')");

    PS it works with strings and fails when working with guids.

    Your help is appreciated.

     

All Replies

  • Wednesday, October 12, 2011 12:00 PM
     
     
    Try using System.Guid.CompareTo
  • Thursday, October 13, 2011 5:44 AM
     
     

    try

    dv.RowFilter = "TypeId in (Convert('<guid>', 'System.Guid'), Convert('<guid>', 'System.Guid'

    Hope will be do 


    Sumit Kumar