Visual Basic 6 to VB.NET advice (desktop apps) !

Posted on 2008-10-09
Last Modified: 2013-11-26
Are there many hurdles to overcome moving to .NET.  Im fine with OO coding as i have used java before.  In VB6/VBA i was using DAO to access databases and compiling to an exectuable was easy for distribution my questions are:

What access methods are availble/recommended in .NET for database access / reading in csv files?
How easy is it to compile all classes and code into a exectuable for distribution?
Is UserIntfaces just as easy to setup ie drag and drop

Your help is much appreaciated

Question by:david_88
  • 2
LVL 53

Expert Comment

Comment Utility
In, there is a new technology, called for interaction with a database.
LVL 53

Accepted Solution

Dhaest earned 250 total points
Comment Utility
>> How easy is it to compile all classes and code into a exectuable for distribution?
Deploying applications

>> UserIntfaces just as easy to setup ie drag and drop
Almost the same way of working like vb6

Assisted Solution

MTEXX earned 250 total points
Comment Utility
Here's a quick CSV reader I use.
Notice it is simply a shared (read static in VB6) function in a class.  EVERYTHING in .net is in a class.
Imports System.IO

Public Class Csv

    ''' <summary>

    ''' Reads a CSV formatted file and returns a two-dimensional non-jagged array.

    ''' </summary>

    ''' <param name="filespec">The file to read.</param>

    ''' <param name="performTrim">If enabled, fields are trimmed after parsing.</param>

    ''' <param name="remark">A remark token, usually "'" or "REM"</param>

    ''' <returns>A two-dimensional non-jagged array of strings.</returns>

    ''' <remarks></remarks>

    Public Shared Function read(ByVal filespec As String, Optional ByVal performTrim As Boolean = True, Optional ByVal remark As String = Nothing) As String()()

        Dim content As String

        Dim sReader As StreamReader


            sReader = New StreamReader(filespec)

            content = sReader.ReadToEnd()


        Catch Ex As Exception

            Return Nothing

        End Try

        Dim lines() As String = content.Split(vbCrLf)

        Dim retval(0)() As String

        Dim firstFlag As Boolean = True

        For i As Integer = LBound(lines) To UBound(lines)

            If (lines(i) = "") Then Continue For

            If (remark IsNot Nothing AndAlso remark <> "" AndAlso lines(i).Trim.StartsWith(remark)) Then Continue For

            Dim words() As String = lines(i).Split(",")

            If (performTrim) Then

                For j As Integer = LBound(words) To UBound(words)

                    words(j) = words(j).Trim


            End If

            If (firstFlag) Then

                firstFlag = False


                ReDim Preserve retval(UBound(retval) + 1)

            End If

            retval(UBound(retval)) = words


        Return retval

    End Function

End Class

Open in new window


Author Closing Comment

Comment Utility
Brilliant just what i need thanks

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now