vb to C#

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

    #1

    vb to C#

    I am converting a vb code to c#. I already converted most of the code except
    for:

    lpn = rsLPN(0)

    How do you convert the above code. It's probably easy but I cant figure it
    out. The entire code follows:

    sLPN = "SELECT Convert(last_pr oject_no,'US7AS CII') FROM pa_control FOR
    UPDATE "

    Set rsLPN = db.Execute (sLPN)

    While not rsLPN.EOF
    Session("LPN")= ""
    lpn = rsLPN(0)

    rsLPN.MoveNext
    wend
    ' STORE LAST_PROJECT_NU MBER IN A VARIABLE CALLED "lpn"

    lpn = lpn + 1
    Session("LPN") = lpn
  • Daniel Groh

    #2
    Re: vb to C#

    try to change the () to []

    Regards

    --

    Atenciosamente,

    Daniel Groh
    CTF Technologies do Brasil Ltda.
    Analista Programador
    Fone: 11 3837-4203
    E-mail: dgroh@ctf.com.b r
    "Newbie" <Newbie@discuss ions.microsoft. com> escreveu na mensagem
    news:6B8C8CAB-CC13-447D-B4B6-143448624125@mi crosoft.com...[color=blue]
    >I am converting a vb code to c#. I already converted most of the code
    >except
    > for:
    >
    > lpn = rsLPN(0)
    >
    > How do you convert the above code. It's probably easy but I cant figure it
    > out. The entire code follows:
    >
    > sLPN = "SELECT Convert(last_pr oject_no,'US7AS CII') FROM pa_control FOR
    > UPDATE "
    >
    > Set rsLPN = db.Execute (sLPN)
    >
    > While not rsLPN.EOF
    > Session("LPN")= ""
    > lpn = rsLPN(0)
    >
    > rsLPN.MoveNext
    > wend
    > ' STORE LAST_PROJECT_NU MBER IN A VARIABLE CALLED "lpn"
    >
    > lpn = lpn + 1
    > Session("LPN") = lpn[/color]


    Comment

    • Eric Cadwell

      #3
      Re: vb to C#

      lpn = rsLPN[0];

      -Eric


      Comment

      • Wayne

        #4
        Re: vb to C#

        assuming the below is VB.net try this link:



        --
        Thanks
        Wayne Sepega
        Jacksonville, Fl

        Enterprise Library Configuration Console Module Generator


        "When a man sits with a pretty girl for an hour, it seems like a minute. But
        let him sit on a hot stove for a minute and it's longer than any hour.
        That's relativity." - Albert Einstein

        "Newbie" <Newbie@discuss ions.microsoft. com> wrote in message
        news:6B8C8CAB-CC13-447D-B4B6-143448624125@mi crosoft.com...[color=blue]
        > I am converting a vb code to c#. I already converted most of the code[/color]
        except[color=blue]
        > for:
        >
        > lpn = rsLPN(0)
        >
        > How do you convert the above code. It's probably easy but I cant figure it
        > out. The entire code follows:
        >
        > sLPN = "SELECT Convert(last_pr oject_no,'US7AS CII') FROM pa_control FOR
        > UPDATE "
        >
        > Set rsLPN = db.Execute (sLPN)
        >
        > While not rsLPN.EOF
        > Session("LPN")= ""
        > lpn = rsLPN(0)
        >
        > rsLPN.MoveNext
        > wend
        > ' STORE LAST_PROJECT_NU MBER IN A VARIABLE CALLED "lpn"
        >
        > lpn = lpn + 1
        > Session("LPN") = lpn[/color]


        Comment

        • Newbie

          #5
          Re: vb to C#

          I appreciate this, but something's not working right. Can u convert the
          entire vb code? Thanks in advance.

          sLPN = "SELECT Convert(last_pr oject_no,'US7AS CII') FROM pa_control FOR
          UPDATE "

          Set rsLPN = db.Execute (sLPN)

          While not rsLPN.EOF
          Session("LPN")= ""
          lpn = rsLPN(0)

          rsLPN.MoveNext
          wend
          ' STORE LAST_PROJECT_NU MBER IN A VARIABLE CALLED "lpn"

          lpn = lpn + 1
          Session("LPN") = lpn

          -----------------------------------------------
          "Eric Cadwell" wrote:
          [color=blue]
          > lpn = rsLPN[0];
          >
          > -Eric
          >
          >
          >[/color]

          Comment

          Working...