int32.parse

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike P

    #1

    int32.parse

    Can anybody convert this from VB.NET to C#?

    If Int32.Parse(ID) = Int32.Parse(dt. Rows(iLoop)("ID ")) then
    Return iLoop
    End If

    Thanks,

    lfc77



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: int32.parse

    Mike,

    This is what you want.

    if (Int32.Parse(ID ) = Int32.Parse((st ring) dt.Rows[iLoop]["ID"]))
    return iLoop;

    This is assuming that the type of ID in the datatable is a string.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nicholas.paldin o@exisconsultin g.com

    "Mike P" <mrp@telcoelect ronics.co.uk> wrote in message
    news:eowKSZ%23Z DHA.628@TK2MSFT NGP10.phx.gbl.. .[color=blue]
    > Can anybody convert this from VB.NET to C#?
    >
    > If Int32.Parse(ID) = Int32.Parse(dt. Rows(iLoop)("ID ")) then
    > Return iLoop
    > End If
    >
    > Thanks,
    >
    > lfc77
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it![/color]


    Comment

    • Morten Wennevik

      #3
      Re: int32.parse

      On Thu, 21 Aug 2003 06:15:39 -0700, Mike P <mrp@telcoelect ronics.co.uk>
      wrote:
      [color=blue]
      > Can anybody convert this from VB.NET to C#?
      >
      > If Int32.Parse(ID) = Int32.Parse(dt. Rows(iLoop)("ID ")) then
      > Return iLoop
      > End If
      >
      > Thanks,
      >
      > lfc77
      >
      >
      >
      > *** Sent via Developersdex http://www.developersdex.com ***
      > Don't just participate in USENET...get rewarded for it!
      >[/color]

      if(Int32.Parse( ID) == Int32.Parse(dt. Rows[iLoop]["ID"])
      {
      return iLoop;
      }

      Not sure if that will work, but you can try.

      --
      Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

      Comment

      • Mike P

        #4
        Re: int32.parse

        This is my code...I keep getting the error 'denotes a 'property' where a
        'method' was expected'. Any ideas?

        <asp:TemplateCo lumn HeaderText="Cal lType">
        <ItemTemplate >
        <%# DataBinder.Eval (Container.Data Item, "CallType") %>
        </ItemTemplate>

        <EditItemTempla te>
        <asp:DropDownLi st runat="server" id="lstCallType s"
        DataValueField= "CallType"
        DataTextField=" CallType"
        DataSource='<%# GetCallTypes() %>'
        SelectedIndex=' <%#
        GetSelIndex(Con tainer.DataItem ("CallType") ) %>'
        />
        </EditItemTemplat e>

        </asp:TemplateCol umn>


        private int GetSelIndex(str ing strCallType)
        {
        int intLoop;
        //Loop through each row in the DataSet
        DataTable dt = ddlDataSet.Tabl es["CallTypes"];

        for (intLoop = 0; intLoop >= dt.Rows.Count-1; intLoop ++)
        {
        if (Int32.Parse(st rCallType) =
        Int32.Parse((st ring)dt.Rows[intLoop]["CallType"]))
        {
        return intLoop;
        }
        }
        }

        Thanks,

        Mike



        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        Working...