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 Offline
    L Offline
    Luis Alonso Ramos
    wrote on last edited by
    #1

    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!

    L G M 3 Replies 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!

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

      Luis Alonso Ramos wrote: Or is there any possibility that I'll like it and never return to C#? Have no fear my friend :) If you have done VB or QB in the past, VB.NET will be a breeze for you, especially since you know the Framework. Essentially, it's the same thing with syntax differences. O'Reilly have a great pocket reference book for converting between C# and VB.NET. I have it and I like it. Here it is.[^] The WORSE that could happen to you, is that you can't come back to C# because you forgot its syntax! You'd then be on the VB.NET side forever. ;P

      L 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!

        G Offline
        G Offline
        Giancarlo Aguilera
        wrote on last edited by
        #3

        A couple of hints you may find helpful. First, open up the IDE->Tools->Options->Project->VB Defaults, and make sure to make Option Strict On the default option so that you don't have to do so for every project. Second, by default C# allows you to edit code while in debug mode, VB does not. If you want to change this, open up the IDE->Tools->Options->Debugging-Edit & Continue, and check the option 'allow me to edit VB files while debugging' Third, you may or may not want to modify the VB text editor properties, perhaps decrease the indent size, etc... to do so, open up the IDE->Tools->Options->Text Editor->Basic and take a look and see what you like and what you don't like. Fourth, you may or may not want to for each and every VB project, Project->Properties->Commom Properties->General, and remove the rootnamespace value only so that you have to explicitly declare the any and all namespaces the way you're use to in C#. The only reason I make a habit of doing this is just to make the coding habits standard whenever I switck back and forth just to avoid confusion. Fifth, you may or may not want to remove all the global project imports (include) from your VB project so that you're forced to explicitly include any namespace you use in the code file. Again, sometimes it's useful to include for example the System namespace just to avoid having to do so manually for each code file, however, just to keep the coding habits standard across both languages and thereby avoid possible confusion when having to switch back and forth, I would recommend that you always remove all global project imports, although I will admit that I fine this feature useful, especially during UI development when I just want to get it over with as soon as possible. Project->Properties->Commom Properties->Imports Sixth, if possible given your project, Project->Properties->Configuration Properties->Optimizations, remove integer overflow checks and enable optimizations. Why this is not the default is beyond me. Seven, Project->Properties->Configuration Properties->Build, you may or may not want to treat compiler warnings as errors. VB is the easiest language in the world so don't even worry about it. Suerte!

        L 1 Reply Last reply
        0
        • L Lost User

          Luis Alonso Ramos wrote: Or is there any possibility that I'll like it and never return to C#? Have no fear my friend :) If you have done VB or QB in the past, VB.NET will be a breeze for you, especially since you know the Framework. Essentially, it's the same thing with syntax differences. O'Reilly have a great pocket reference book for converting between C# and VB.NET. I have it and I like it. Here it is.[^] The WORSE that could happen to you, is that you can't come back to C# because you forgot its syntax! You'd then be on the VB.NET side forever. ;P

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

          Carl Mercier wrote: VB.NET will be a breeze for you Yes, I'm actually expecting that. I was just asking for some aspects of the language I will miss (I can think of XML comments -- I usually use them a lot to get a documentation of the code, public or not.) Carl Mercier wrote: you can't come back to C# because you forgot its syntax! You'd then be on the VB.NET side forever No way!! I can always relearned it! ;P -- LuisR


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

          J 1 Reply Last reply
          0
          • G Giancarlo Aguilera

            A couple of hints you may find helpful. First, open up the IDE->Tools->Options->Project->VB Defaults, and make sure to make Option Strict On the default option so that you don't have to do so for every project. Second, by default C# allows you to edit code while in debug mode, VB does not. If you want to change this, open up the IDE->Tools->Options->Debugging-Edit & Continue, and check the option 'allow me to edit VB files while debugging' Third, you may or may not want to modify the VB text editor properties, perhaps decrease the indent size, etc... to do so, open up the IDE->Tools->Options->Text Editor->Basic and take a look and see what you like and what you don't like. Fourth, you may or may not want to for each and every VB project, Project->Properties->Commom Properties->General, and remove the rootnamespace value only so that you have to explicitly declare the any and all namespaces the way you're use to in C#. The only reason I make a habit of doing this is just to make the coding habits standard whenever I switck back and forth just to avoid confusion. Fifth, you may or may not want to remove all the global project imports (include) from your VB project so that you're forced to explicitly include any namespace you use in the code file. Again, sometimes it's useful to include for example the System namespace just to avoid having to do so manually for each code file, however, just to keep the coding habits standard across both languages and thereby avoid possible confusion when having to switch back and forth, I would recommend that you always remove all global project imports, although I will admit that I fine this feature useful, especially during UI development when I just want to get it over with as soon as possible. Project->Properties->Commom Properties->Imports Sixth, if possible given your project, Project->Properties->Configuration Properties->Optimizations, remove integer overflow checks and enable optimizations. Why this is not the default is beyond me. Seven, Project->Properties->Configuration Properties->Build, you may or may not want to treat compiler warnings as errors. VB is the easiest language in the world so don't even worry about it. Suerte!

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

            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 1 Reply Last reply
            0
            • L Luis Alonso Ramos

              Carl Mercier wrote: VB.NET will be a breeze for you Yes, I'm actually expecting that. I was just asking for some aspects of the language I will miss (I can think of XML comments -- I usually use them a lot to get a documentation of the code, public or not.) Carl Mercier wrote: you can't come back to C# because you forgot its syntax! You'd then be on the VB.NET side forever No way!! I can always relearned it! ;P -- LuisR


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

              J Offline
              J Offline
              Joshua Quick
              wrote on last edited by
              #6

              Luis Alonso Ramos wrote: I was just asking for some aspects of the language I will miss (I can think of XML comments -- I usually use them a lot to get a documentation of the code, public or not.) There is a Visual Studio plug-in that will add XML comments support for VB.Net. You can find it here. http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=112b5449-f702-46e2-87fa-86bdf39a17dd[^]

              L 1 Reply Last reply
              0
              • J Joshua Quick

                Luis Alonso Ramos wrote: I was just asking for some aspects of the language I will miss (I can think of XML comments -- I usually use them a lot to get a documentation of the code, public or not.) There is a Visual Studio plug-in that will add XML comments support for VB.Net. You can find it here. http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=112b5449-f702-46e2-87fa-86bdf39a17dd[^]

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

                Thanks! Looks good, but I'll take a more detailed look at it. -- LuisR


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

                1 Reply Last reply
                0
                • 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