vb to cSharp conversion

Discussion in 'ASP .Net' started by arun@greettech.com, Jan 30, 2007.

  1. Guest

    Hi
    Any one kno what is the C3 equivalent of vb
    DataSetObj .Tables(0).Rows(0).Item("ID")

    Thanks in Advance
     
    , Jan 30, 2007
    #1
    1. Advertising

  2. Mark Rae Guest

    "" <> wrote in message
    news:...

    > Any one kno what is the C3 equivalent of vb
    > DataSetObj .Tables(0).Rows(0).Item("ID")


    DataSetObj .Tables[0].Rows[0].Item["ID"];
     
    Mark Rae, Jan 30, 2007
    #2
    1. Advertising

  3. Flip the () to [] and add a SemiColor on hte end:

    DataSetObj .Tables[0].Rows[0].Item["ID"];


    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    http://gregorybeamer.spaces.live.com

    ********************************************
    Think outside the box!
    ********************************************
    "" <> wrote in message
    news:...
    > Hi
    > Any one kno what is the C3 equivalent of vb
    > DataSetObj .Tables(0).Rows(0).Item("ID")
    >
    > Thanks in Advance
    >
     
    Cowboy \(Gregory A. Beamer\), Jan 30, 2007
    #3
  4. Guest

    (Sorry for typo error)..

    No that is not the correct answer. In c# there is no property Item...
    Only Item array is there... that too we cant access like
    DataSetObj .Tables(0).Rows(0).Item("ID")
    We have to DataSetObj .Tables[0].Rows[0].ItemArray[0];
     
    , Jan 30, 2007
    #4
  5. DataSetObj .Tables[0].Rows[0]["ID"]

    "" <> wrote in message
    news:...
    > Hi
    > Any one kno what is the C3 equivalent of vb
    > DataSetObj .Tables(0).Rows(0).Item("ID")
    >
    > Thanks in Advance
    >
     
    Petr Jankovský, Jan 30, 2007
    #5
  6. Ups plus semicolon at the end:)
    DataSetObj .Tables[0].Rows[0]["ID"];
    "Petr Jankovský" <> wrote in message
    news:...
    > DataSetObj .Tables[0].Rows[0]["ID"]
    >
    > "" <> wrote in message
    > news:...
    >> Hi
    >> Any one kno what is the C3 equivalent of vb
    >> DataSetObj .Tables(0).Rows(0).Item("ID")
    >>
    >> Thanks in Advance
    >>

    >
    >
     
    Petr Jankovský, Jan 30, 2007
    #6
  7. sloan Guest

    Other have missed this one (some of them)

    whenever you see the word .Item in VB.NET, it usually (always?) is the
    indexer in c#

    so

    someObject.Item("ID")
    is
    someObject["ID"]
    in C#

    so most times its just [] for (), except for the indexer (which is .Item in
    vb.net)

    DataSetObj .Tables[0].Rows[0]["ID"]



    "" <> wrote in message
    news:...
    > Hi
    > Any one kno what is the C3 equivalent of vb
    > DataSetObj .Tables(0).Rows(0).Item("ID")
    >
    > Thanks in Advance
    >
     
    sloan, Jan 30, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Piero Massari

    tool to make a class diagram from csharp

    Piero Massari, Jun 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    520
    Sahil Malik
    Jun 17, 2004
  2. Natty Gur
    Replies:
    0
    Views:
    419
    Natty Gur
    Jul 27, 2003
  3. CSDunn

    ASP.NET not processing CSharp code

    CSDunn, Jan 7, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    430
    CSDunn
    Jan 14, 2004
  4. Vili
    Replies:
    1
    Views:
    576
    Eric Cherng
    Jun 28, 2004
  5. John
    Replies:
    1
    Views:
    3,228
    Scott Allen
    Jul 26, 2004
Loading...

Share This Page