yusuf

yusuf

  • NA
  • 57
  • 0

Could not convert to C#

Sep 4 2009 10:52 PM
Hello friends, I have a code in VB and could not change it to C#. There is a DataTable and i want to read the values of one column. If Rows.Item(0).ToString.StartsWith(prefixText, StringComparison.OrdinalIgnoreCase) Then retvalitems.Add(Rows.Item(0).ToString) End If

Answers (2)

0
Master  Billa

Master Billa

  • 0
  • 1.7k
  • 0
Sep 4 2009 11:42 PM
HI

Here converted code

 if(Rows.Item[0].ToString().StartsWith(prefixText, StringComparison.OrdinalIgnoreCase)
        {
            retvalitems.Add(Rows.Item[0].ToString());
        }

thank you

0
yusuf

yusuf

  • 0
  • 57
  • 0
Sep 4 2009 11:35 PM
The problem is solved with if (Mydt.Rows[i]["FieldName"].ToString().StartsWith(prefixText,StringComparison.OrdinalIgnoreCase)) { // } sorry for unnecessary question. (: