locked
Compare two datatable ..ignore case sensivity,, RRS feed

  • Question

  • Hi friends,,

    How to compare two datatable columns and ignore the case sensitivity..in c# windows application..

    Saturday, January 25, 2014 11:41 AM

Answers

  • Hi.. thanks for the reply...

    i found the answer myself...

    if (DataTable.Rows[i]["Name"].ToString().ToLower().Trim() == DataSet.Tables[0].Rows[j]["FirstName"].ToString().ToLower().Trim() && DataTable.Rows[i]["Name"].ToString().Length > 0)

    now it ill ignore case sensittive and spaces..

    • Proposed as answer by Cor Ligthert Monday, January 27, 2014 9:45 AM
    • Marked as answer by Barry Wang Wednesday, January 29, 2014 10:21 AM
    Monday, January 27, 2014 5:03 AM

All replies

  • You ask this in one of the forums for windows desktop user interface programming. 

    Ask this in the forum for datasets (the wrapper around datatables)

    http://social.msdn.microsoft.com/Forums/en-US/home?forum=adodotnetdataset


    Success
    Cor

    Sunday, January 26, 2014 6:37 PM
  • Hi.. thanks for the reply...

    i found the answer myself...

    if (DataTable.Rows[i]["Name"].ToString().ToLower().Trim() == DataSet.Tables[0].Rows[j]["FirstName"].ToString().ToLower().Trim() && DataTable.Rows[i]["Name"].ToString().Length > 0)

    now it ill ignore case sensittive and spaces..

    • Proposed as answer by Cor Ligthert Monday, January 27, 2014 9:45 AM
    • Marked as answer by Barry Wang Wednesday, January 29, 2014 10:21 AM
    Monday, January 27, 2014 5:03 AM