Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Easy Questions for CPians

Easy Questions for CPians

Scheduled Pinned Locked Moved Visual Basic
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sebastien Lachance
    wrote on last edited by
    #1

    :laugh: Wich is better : Dim myAdapter as oledbDataAdapter = new oledbDataAdapter("bla bla") or Dim myAdapter as new oledbDataAdapter("Bla bla") .:doh:

    D 1 Reply Last reply
    0
    • S Sebastien Lachance

      :laugh: Wich is better : Dim myAdapter as oledbDataAdapter = new oledbDataAdapter("bla bla") or Dim myAdapter as new oledbDataAdapter("Bla bla") .:doh:

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Neither. They produce exactly the same IL code. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Neither. They produce exactly the same IL code. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        S Offline
        S Offline
        Sebastien Lachance
        wrote on last edited by
        #3

        And Integer.Parse or CINT OR CTYPE ?

        D 1 Reply Last reply
        0
        • S Sebastien Lachance

          And Integer.Parse or CINT OR CTYPE ?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          These three functions don't do the same things, so your trying to compare apples to oranges to banana's. Integer.Parse attempts to create an 32-bit signed integer out of a text string. CInt attempts to convert the value of a numeric datatype into a signed 32-bit integer value. CType attempts to convert one datatype into another datatype. This works with numeric types, objects, structures, classes, interfaces, ... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          S 1 Reply Last reply
          0
          • D Dave Kreskowiak

            These three functions don't do the same things, so your trying to compare apples to oranges to banana's. Integer.Parse attempts to create an 32-bit signed integer out of a text string. CInt attempts to convert the value of a numeric datatype into a signed 32-bit integer value. CType attempts to convert one datatype into another datatype. This works with numeric types, objects, structures, classes, interfaces, ... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            S Offline
            S Offline
            Sebastien Lachance
            wrote on last edited by
            #5

            ok thanks a lot :) You really are a very helpfull resources :) Now for the last question : Dim ocls as Classname or Private (public etc..) ocls as Classname in the Code-Behind (not in methods). I'm sorry for all those question, it's just thing i havent paid attention, in my learning process.

            D 1 Reply Last reply
            0
            • S Sebastien Lachance

              ok thanks a lot :) You really are a very helpfull resources :) Now for the last question : Dim ocls as Classname or Private (public etc..) ocls as Classname in the Code-Behind (not in methods). I'm sorry for all those question, it's just thing i havent paid attention, in my learning process.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              At this level, both of your statements generate the exact same code. If Public or Private is specified, the Dim keyword becomes optional. If there is no access modifier specified, Dim must be used and the variable is Private by default. These three statements do the exact smae thing:

              Class myClass
              Private Dim mstrLine1 As String
              Private mstrLine2 As String
              Dim mstrLine3 As String
              End Class

              RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              S 1 Reply Last reply
              0
              • D Dave Kreskowiak

                At this level, both of your statements generate the exact same code. If Public or Private is specified, the Dim keyword becomes optional. If there is no access modifier specified, Dim must be used and the variable is Private by default. These three statements do the exact smae thing:

                Class myClass
                Private Dim mstrLine1 As String
                Private mstrLine2 As String
                Dim mstrLine3 As String
                End Class

                RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                S Offline
                S Offline
                Sebastien Lachance
                wrote on last edited by
                #7

                Great, thank you very much.:)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups