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. The Lounge
  3. Learning VB.NET??

Learning VB.NET??

Scheduled Pinned Locked Moved The Lounge
csharpdatabaseasp-netsql-server
18 Posts 8 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.
  • L Luis Alonso Ramos

    Giancarlo Aguilera wrote: Option Strict On If I remember correctly, that makes me declare all variables prior to using them, doesn't it? Any other things it does? Giancarlo Aguilera wrote: you may or may not want to treat compiler warnings as errors I always do. Giancarlo Aguilera wrote: VB is the easiest language in the world so don't even worry about it. Actually I'm not worried. I've used Visual Basic before, so I know the syntax. I just expect a few days of again getting used to it... like putting semicolons after statements, for example. :) -- LuisR


    Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

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

    You will need to cast your variable to the correct type and forget about late-binding, wich is a good thing. :) My Blog

    L 1 Reply Last reply
    0
    • S Sebastien Lachance

      You will need to cast your variable to the correct type and forget about late-binding, wich is a good thing. :) My Blog

      L Offline
      L Offline
      Luis Alonso Ramos
      wrote on last edited by
      #9

      And how do I cast in VB.NET? Visual Basic had CBool, CInt, CStr and so on. Is it the same in VB.NET? Yes, you could consider this a programming question... and so what? ;P -- LuisR


      Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

      D L 2 Replies Last reply
      0
      • L Luis Alonso Ramos

        And how do I cast in VB.NET? Visual Basic had CBool, CInt, CStr and so on. Is it the same in VB.NET? Yes, you could consider this a programming question... and so what? ;P -- LuisR


        Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

        D Offline
        D Offline
        DavidNohejl
        wrote on last edited by
        #10

        Luis Alonso Ramos wrote: Yes, you could consider this a programming question... and so what? Nah, it's only pseudoprogramming question :P David Never forget: "Stay kul and happy" (I.A.)
        David's thoughts / dnhsoftware.org / MyHTMLTidy

        1 Reply Last reply
        0
        • L Luis Alonso Ramos

          And how do I cast in VB.NET? Visual Basic had CBool, CInt, CStr and so on. Is it the same in VB.NET? Yes, you could consider this a programming question... and so what? ;P -- LuisR


          Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #11

          You can use CBool, CInt and so on, but I think they were added for compatibility with VB6 only. The real way to do it would be: CType(x, Integer) (casts x to an integer) or DirectCast(o, Guid) (Direct Cast is pretty much used for unboxing. For example, you have a GUID stored in an Object, you could cast it to a Guid using DirectCast. DirectCast will NOT convert types. You cannot DirectCast an Integer into a Double, for example). DirectCast is faster than CType so whenever possible, use it.

          S L 2 Replies Last reply
          0
          • L Lost User

            You can use CBool, CInt and so on, but I think they were added for compatibility with VB6 only. The real way to do it would be: CType(x, Integer) (casts x to an integer) or DirectCast(o, Guid) (Direct Cast is pretty much used for unboxing. For example, you have a GUID stored in an Object, you could cast it to a Guid using DirectCast. DirectCast will NOT convert types. You cannot DirectCast an Integer into a Double, for example). DirectCast is faster than CType so whenever possible, use it.

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

            Or Integer.Parse(variable), Boolean.Parse(variable). :) My Blog

            1 Reply Last reply
            0
            • L Luis Alonso Ramos

              Last week I got a project with one of the offices in the local goverment (we had been negotiating for about two months). Today I met with the systems office of the government, and he said that he had read my proposal and that he liked very much, but that he wanted me to do it in VB.NET instead of C#, and using Oracle as a database instead of my proposed SQL Server. It's an ASP.NET application that won't have a lot of traffic, so I was planning on using MSDE. The database choice is OK because all their databases run on Oracle, and they already have scheduled backups and maintaince. I'm fine with it. And the reason for using VB.NET instead of C# is because all his people (who are supposed to maintain my app in the future) use it, and most don't know C#. I still tried to persuade him, but finally I agreed. I've never used VB.NET, so, will I have any troubles? I've used QuickBasic and Visual Basic in the past, but I've since got used to C#. Other that fighthing with the syntax at the beginning, are there any features from C# I will miss? Or is there any possibility that I'll like it and never return to C#? :omg: -- LuisR


              Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

              M Offline
              M Offline
              Member 96
              wrote on last edited by
              #13

              I faced a similar situation a while back and you might find it very helpful at first to have on hand a good decompiler like Anakrino http://www.saurik.com/net/exemplar/[^] Write the tricky bits in c#, then decompile the assembly back to vb.net code to see what the differences are. It's extremely useful that way. Secondly there is a nice cheat sheet here: http://www.dnzone.com/ShowDetail.asp?NewsId=356[^] Illustrating language syntax differences between c# and vb.net, good as a reference.


              "In our civilization, and under our republican form of government, intelligence is so highly honored that it is rewarded by exemption from the cares of office." - Ambrose Bierce

              D L 2 Replies Last reply
              0
              • M Member 96

                I faced a similar situation a while back and you might find it very helpful at first to have on hand a good decompiler like Anakrino http://www.saurik.com/net/exemplar/[^] Write the tricky bits in c#, then decompile the assembly back to vb.net code to see what the differences are. It's extremely useful that way. Secondly there is a nice cheat sheet here: http://www.dnzone.com/ShowDetail.asp?NewsId=356[^] Illustrating language syntax differences between c# and vb.net, good as a reference.


                "In our civilization, and under our republican form of government, intelligence is so highly honored that it is rewarded by exemption from the cares of office." - Ambrose Bierce

                D Offline
                D Offline
                Daniel Grunwald
                wrote on last edited by
                #14

                Anakrino a good decompiler??? Try Reflector[^], you'll have a different view on Anakrino after that!

                L 1 Reply Last reply
                0
                • M Member 96

                  I faced a similar situation a while back and you might find it very helpful at first to have on hand a good decompiler like Anakrino http://www.saurik.com/net/exemplar/[^] Write the tricky bits in c#, then decompile the assembly back to vb.net code to see what the differences are. It's extremely useful that way. Secondly there is a nice cheat sheet here: http://www.dnzone.com/ShowDetail.asp?NewsId=356[^] Illustrating language syntax differences between c# and vb.net, good as a reference.


                  "In our civilization, and under our republican form of government, intelligence is so highly honored that it is rewarded by exemption from the cares of office." - Ambrose Bierce

                  L Offline
                  L Offline
                  Luis Alonso Ramos
                  wrote on last edited by
                  #15

                  John Cardinal wrote: _Secondly there is a nice cheat sheet here: http://www.dnzone.com/ShowDetail.asp?NewsId=356\[^\]_ I took a quick look at that one, and it seems very complete. I'll have to print it to keep it handy, since there are several syntax differences I didn't know about. Thanks! -- LuisR


                  Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                  1 Reply Last reply
                  0
                  • D Daniel Grunwald

                    Anakrino a good decompiler??? Try Reflector[^], you'll have a different view on Anakrino after that!

                    L Offline
                    L Offline
                    Luis Alonso Ramos
                    wrote on last edited by
                    #16

                    I use Refelector almost daily, it's really good! So Anakrino is in no way better? I just looked at their web page and it's no precisely beautiful. -- LuisR


                    Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                    D 1 Reply Last reply
                    0
                    • L Lost User

                      You can use CBool, CInt and so on, but I think they were added for compatibility with VB6 only. The real way to do it would be: CType(x, Integer) (casts x to an integer) or DirectCast(o, Guid) (Direct Cast is pretty much used for unboxing. For example, you have a GUID stored in an Object, you could cast it to a Guid using DirectCast. DirectCast will NOT convert types. You cannot DirectCast an Integer into a Double, for example). DirectCast is faster than CType so whenever possible, use it.

                      L Offline
                      L Offline
                      Luis Alonso Ramos
                      wrote on last edited by
                      #17

                      Ok, thanks! :) -- LuisR


                      Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                      1 Reply Last reply
                      0
                      • L Luis Alonso Ramos

                        I use Refelector almost daily, it's really good! So Anakrino is in no way better? I just looked at their web page and it's no precisely beautiful. -- LuisR


                        Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

                        D Offline
                        D Offline
                        Daniel Grunwald
                        wrote on last edited by
                        #18

                        No new Anakrino version was released since 2002, only a configuration fix to make the old version working on .NET 1.1. It crashes whenever it encounters something that isn't IL code from the Microsoft compilers. Last time I checked, it even crashed when decompiling a method that contained nothing special except an unicode char literal! I does not highlight the decompiled code and has no code navigation. I used Anakrino first because I didn't know Reflector, but I never looked back to Anakrino after trying Reflector.

                        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