Announcement

Collapse
No announcement yet.

VB.Net example?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VB.Net example?

    Does anyone have a simple example project written in VB.Net? The examples on the File Download page are written in VB 6.0 and I didn't realize 6.0 was not compatible with .Net when I bought .Net.

    I'm just looking for something that will compile that will, for example, download some historical data and display it. You can attach a zipped project (up to 100kb) to a post.

  • #2
    Hi Foz,

    If you just open the existing VB examples, they will automatically convert to VB.Net. They then work fine. It will put a number of warnings in about default parameters not being able to be set, but just ignore them.

    The issue is that VB.Net is a much stricter language than VB.

    Hope this helps.

    Paul

    Comment


    • #3
      Thanks, Paul. But when I try to open one of the VB examples from the File Download area with the Microsoft Development Environment 2002 with VB.Net installed I get: "Visual Basic 6.0 migration is not supported with this edition of Visual Studio." and it doesn't open.

      It sounds like your version of Visual Studio is able to do the migration? Could you do the migration and save it and zip the project and post it? Or maybe Robi could?

      I thought maybe I could create a new project and cut and paste in the form code. But the code in the VB 6.0 Form1.frm looks very different from the VB.Net Form1.vb code I'm used to.
      Last edited by Foz; 03-26-2004, 08:35 AM.

      Comment


      • #4
        Here is the VB sample converted. You will need to create a new project in VS.Net 2002 as I am using 2003. Then just import the source files.



        Paul
        Attached Files

        Comment


        • #5
          Here is the TimeAndSales Sample

          Paul
          Attached Files

          Comment


          • #6
            Thanks, Paul. There is a SelectItem string method in the vb example that is unique to VB6. VB.net users who have the Upgrade Wizard (like you do) will also have a VB6 compatibility library that makes it possible to use this method.

            The statement is:

            VB6.SetItemString( 1stHistory, 0, sbar )

            I don't appear to have the compatibility library and I know for certain that the Upgrade Wizard does not come with my Standard Edition of VB.net. Does anyone know if it's possible to get this compatibility library from somewhere? Or, better yet, is there an experienced coder who could fix the vb example to not use this method?

            Here's a link that talks about how there is no equivalent in VB.net for this method: http://msdn.microsoft.com/library/de...haschanged.asp

            Comment


            • #7
              Well, being a newbie programmer, I have no idea what that SetItemString method does so what is the obvious thing to do?

              That's right, I just commented it out. The project compiled just fine and is working well. I'm not sure what functionality I am missing without that line, but I'm getting quotes in my little application.

              Now, on to learning VB.net and putting those quotes to work!

              Comment

              Working...
              X