Converting code from VB6 to VB.NET and learning

I have been programming in VB6 for years.  I have a desire to begin programming in VB.NET.  With .NET would I be able to make my application usuable from a webpage?  The current program I have is written in VB6 and can only be used from a windows desktop.  Here is one of my forms below for registering individuals in VB6.  What is the fastest way to begin learning how to convert this code into VB.NET?  If I get the .NET software does it have the ability to convert and if it does, how well does it perform?

Thanks for answering my preliminary questions as I know I have a road ahead.

Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
conn.Open "Provider=sqloledb;Data Source=" & ConnectionIP & ",1433;Network Library=DBMSSOCN;Initial Catalog= " & CAPDB & "; User ID=xx;Password=xxxx"

   ' If Not AsNumbers(Me.Text19.Text) Then
   '     MsgBox "Please enter a valid address", vbOKOnly
   '     Exit Sub
   ' End If


If DTPicker1 = ServerTime Then
    MsgBox "You Need to enter a BirthDate", vbOKOnly
    Exit Sub
End If

If Val(Text6) <= 0 Then
    MsgBox "Your Birthdate is Incorrect.  Please adjust.", vbOKOnly
    Exit Sub
End If

If Text2 = "" Then
    MsgBox "You Need to enter a Last Name", vbOKOnly
    Exit Sub
End If

If Text3 = "" Then
    MsgBox "You Need to enter an First Name", vbOKOnly
    Exit Sub
End If

If Combo12 = "CCASP" Or Combo12 = "Scouting Network" Then
    If Combo6 = "" Then
    MsgBox "You Need to enter a Sub Group", vbOKOnly
    Exit Sub
    End If
    

    If Check10 = 1 And Text11 = "" Then
    MsgBox "You Need to Enter a Student ID", vbOKOnly
    Exit Sub
    End If


    If Combo13 = "" Then
    MsgBox "You Need to select an Ethnicity", vbOKOnly
    Exit Sub
    End If
    
 GoTo Procedure1

End If

If Combo14 = "" Then
    MsgBox "You Need to answer question regarding IDHS services", vbOKOnly
    Exit Sub
End If





If DTPicker2 = ServerTime Then
        If MsgBox("Did you want to use TODAY'S DATE for your registration date?", vbYesNo Or vbQuestion, "Add Another?") = vbNo Then
            MsgBox "Ok.  Please select a different Registration date.", vbOKOnly
            Exit Sub
        End If
End If


If Check11 = 0 And Check13 = 0 And Check1 = 0 And Check2 = 0 And Check3 = 0 And Check4 = 0 And Check5 = 0 And Check6 = 0 Then
    If MsgBox("Is this individual a Volunteer, Youth Committee Member, Community Committee Member, Community Resident, Parent, etc?", vbYesNo Or vbQuestion, "Additional Question") = vbYes Then
    MsgBox "Please go back to the top of the form and check the appropriate box", vbOKOnly
    Exit Sub
    End If
End If


    

    
If Val(Text6) < 18 Then
    If Text8 = "" Then
    MsgBox "You Need to enter a Parent/Guardian for this Individual", vbOKOnly
    Exit Sub
    End If
  
    
End If

Procedure1:


esql = "select count(*) from tblOrgRegistrations where [LastName] = '" & Text2 & "' And [FirstName] = '" & Text3 & "' And BirthDate = '" & Format$(DTPicker1.Value, "mm/dd/yyyy") & "' And Fiscal = " & Fiscal
        rec.Open (esql), conn, adOpenDynamic, adLockOptimistic

        If Not rec.Fields(0) = 0 Then
        MsgBox "This person is already in the database.  To avoid DUPLICATION enter a different individual or contact the CAP Administrator for further assistance.", vbOKOnly, "Duplicate Found"
        Text2 = ""
        Text3 = ""
        DTPicker1 = ServerTime
        Exit Sub
        End If

        If Not rec.EOF Then rec.MoveNext
        rec.Close
        

        
        


esql = "select count(*) from tblRegistrationSYAB where Text1 = '" & Text2 & "' And Text2 = '" & Text3 & "' And Text3 = '" & Format$(DTPicker1.Value, "mm/dd/yyyy") & "'"
        rec.Open (esql), conn, adOpenDynamic, adLockOptimistic

        If Not rec.Fields(0) = 0 Then

        MsgBox "Please enter a different individual.  This one is already in SYAB.", vbOKOnly, "Duplicate"
        Text2 = ""
        Text3 = ""
        DTPicker1 = ""
        Exit Sub
        End If

        If Not rec.EOF Then rec.MoveNext
        rec.Close
        
        

                esql = "select GetDate()"
                rec.Open (esql), conn, adOpenStatic, adLockReadOnly
                ServerTime = rec.Fields(0)
                rec.Close
        
        'Select AgencyID------------------
       esql = "select AgencyID from tblOrgProfile where [System Name] ='" & Combo12 & "'"
       rec.Open (esql), conn, adOpenDynamic, adLockOptimistic
       
       AgencyID = rec!AgencyID
       
       If Not rec.EOF Then rec.MoveNext
       rec.Close




        esql = "select * from tblOrgRegistrations"
        rec.Open (esql), conn, adOpenDynamic, adLockOptimistic
        rec.AddNew
        
        rec!Agency = AddRegistration.Combo12
        rec!AgencyID = AgencyID
        rec!RegDate = AddRegistration.DTPicker2.Value
        rec!FirstName = AddRegistration.Text3
        rec!LastName = AddRegistration.Text2
        rec!NickName = AddRegistration.Text5
        rec!Birthdate = DTPicker1.Value
        rec!AgeReg = AddRegistration.Text6
        rec!Participant = AddRegistration.Check10.Value
        rec!Volunteer = AddRegistration.Check11.Value
        rec!YouthCommittee = AddRegistration.Check1.Value
        rec!Board = AddRegistration.Check13.Value
        rec!CommunityResident = AddRegistration.Check2
        rec!Parentcheck = AddRegistration.Check3
        rec!AreaProject = AddRegistration.Check6
        rec!CAPStaff = AddRegistration.Check5
        rec!FCCM = AddRegistration.Check4
        rec!Sector = AddRegistration.Combo5
        rec!Gender = AddRegistration.Combo10
        rec!Address = AddRegistration.Text19
        rec!City = AddRegistration.Text20
        rec!ZIP = AddRegistration.Text21
        rec!Phone = AddRegistration.Text7
        rec!Email = AddRegistration.Text10
        rec!Race = AddRegistration.Combo1
        rec!Language = AddRegistration.Combo7
        rec!Parent = AddRegistration.Text8
        rec!EmergencyContact = AddRegistration.Text4
        rec!EmerRelationship = AddRegistration.Text9
        rec!EmerPhone = AddRegistration.Text14
        rec!EnrolledSchool = AddRegistration.Combo8
        rec!School = AddRegistration.Text12
        rec!Grade = AddRegistration.Combo3
        rec!Referral = AddRegistration.Combo9
        rec!Service = AddRegistration.Combo4
        rec!CommunityArea = AddRegistration.Combo2
        rec!EntryTime = ServerTime
        rec!Fiscal = Fiscal
        rec!SubGroup = AddRegistration.Combo6
        rec!Preparer = AddRegistration.Text16
        rec!BackgroundInfo = AddRegistration.Text1
        rec!StudentID = AddRegistration.Text11
        rec!IDHS = AddRegistration.Combo14
                
        
            
            
        If Not rec.EOF Then rec.MoveNext
        rec.Close
        

If MsgBox("Would you like to print this record?", vbYesNo Or vbQuestion, "Print Record") = vbYes Then
Me.PrintForm
End If

If MsgBox("Would you like to print Parent Consent Form?", vbYesNo Or vbQuestion, "Print Form") = vbYes Then
Printer.Print ""
Printer.PaintPicture Picture2.Picture, 0, 0, 12000, 12000
Printer.EndDoc
End If


  For Each myCtl In Me.Controls
    If TypeOf myCtl Is TextBox Then
      myCtl.Text = ""
    End If
    Next myCtl
    


Dim i As Integer
  For Each myCtl In Me.Controls
    If TypeOf myCtl Is ComboBox Then
        For i = 0 To myCtl.ListCount - 1
            
            strText = myCtl.List(i)
            If strText = "" Then
                myCtl.ListIndex = i
                Exit For
            End If
        Next i
    End If
  Next myCtl



  
  For Each myCtl In Me.Controls
    If TypeOf myCtl Is CheckBox Then
        myCtl.Value = 0
    End If
  Next myCtl
  
MsgBox "The record has been sent to the database", vbOKOnly

                esql = "select GetDate()"
                rec.Open (esql), conn, adOpenStatic, adLockReadOnly
                ServerTime = Format$(rec.Fields(0), "mm/dd/yyyy")
                rec.Close
                
                DTPicker1 = ServerTime
                DTPicker2 = ServerTime
                
                
If Not DataGridOrganization = "Administrator" Then
Combo12.Text = DataGridOrganization
End If

Command5.Enabled = True

End Sub

Open in new window

al4629740Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
There were some VB6 to .NET converters created, but they create as much work as they "save". If you want to learn .NET coding, converting a working app is a good exercise.

If you want to "webify" your VB6 app you'll need to learn ASP.NET if you want to stay with Microsoft Technologies. VB.NET would be used for your "code behind:.

Regarding your code:

You still use database connections, but you do so through the relevant Namespace. If you're using SQL Server, you could do this:

Using con As New System.Data.SQLClient.SQLConnection (Your connection string)
  Using cmd as New System.Data.SQLClient.SQLCommand
    cmd.connection = con
    cmd.CommandText = "Your SQL String"
    Using dt As New DataTable
      dt.Load(cmd.ExecuteReader)
      For each dtr As DataRow in dt.Rows
      Next
    End Using
  End Using
End Using
 
A "DataTable" is a client side data storage container, similar to an ADO Recordset.

To get a count, you use ExecuteScalar:

cmd.CommandText ="SELECT COUNT(*) FROM SomeTable"
Dim cnt As Integer = cmd.ExecuteScalar
0
al4629740Author Commented:
So just to be clear. If I want to Webify my app then will the whole thing  need to be done in ASP.net? What role does VB.net have at that point?
0
al4629740Author Commented:
Also,  my VB6 works with excel office for exporting.  Not sure if that’s a factor in any of this
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Nitin SontakkeDeveloperCommented:
ASP.NET is a framework for developing web-applications. It encapsulates much of the routine work a developer have to do in a nice way and leaves only the core stuff to the developer. Windows Forms and Web Forms while look and feel similar on the surface, their underlying mechanism works on complete unrelated different paradigm, which you will need to understand. Earlier the better.

The language you use to code in the framework is of your choice. If you ask me, however bitter it may sound at the moment, in my strictly personal opinion, you are better of moving to C# right away. There are so many new things to learn, one more won't be much pain, I believe. Or it will be much less an painful than you might you think it would be. I may not be able to give you perfectly rational rationale as to why I suggest you move to C#.

One more thing is your code is not separated in layers, which is not a good practise. You should be lot more classes than you currently have. The business classes (also called Models) are missing, which are required.

There are too many pointer to mention here. Please be generally aware that the .NET is completely a different think than the classic VB. There are as many thing to unlearn for you as to learn.

Please feel free to ask more question. In fact, (hopefully) I can even give a kick-start application, if you wish and share all necessary stuff. May be just one form or something like that.

If you are taking web path, you will also need basic understanding of HTML, JavaScript, CSS, etc.
0
it_saigeDeveloperCommented:
If you ask me, however bitter it may sound at the moment, in my strictly personal opinion, you are better of moving to C# right away.
I disagree with this statement.  Don't get me wrong C# is a fantastic language, but at the end of the day, C# and VB.NET get compiled into the same intermediate language assembly.  You will actually be better off sticking with what you know and converting from VB6 to VB.NET.  You will find that VB.NET while a little *different* is extremely easy to transition to from a pure language perspective.

As for ASP.NET, don't be scared of it.  ASP.NET while a web-based application architecture, still uses VB.NET and/or C# backend components.

I would first start by converting your code to VB.NET so that you can learn the differences in the language.  Let's start with what you have presented here.  Converted it might resemble something like:
Imports ADODB
Imports System.Drawing
Imports System.Drawing.Printing
Imports System.Windows.Forms

Public Class AddRegistration
	Inherits Form
	Private ServerTime As New DateTime
	Private ConnectionIP As String
	Private CAPDB As String
	Private esql As String
	Private AgencyID As Integer
	Private Fiscal As String
	Friend WithEvents DTPicker1 As New DateTimePicker
	Friend WithEvents DTPicker2 As New DateTimePicker
	Friend WithEvents Text6 As New TextBox
	Friend WithEvents Text2 As New TextBox
	Friend WithEvents Text3 As New TextBox
	Friend WithEvents Text11 As New TextBox
	Friend WithEvents Text8 As New TextBox
	Friend WithEvents Text5 As New TextBox
	Friend WithEvents Text19 As New TextBox
	Friend WithEvents Text20 As New TextBox
	Friend WithEvents Text21 As New TextBox
	Friend WithEvents Text7 As New TextBox
	Friend WithEvents Text10 As New TextBox
	Friend WithEvents Text4 As New TextBox
	Friend WithEvents Text9 As New TextBox
	Friend WithEvents Text14 As New TextBox
	Friend WithEvents Text12 As New TextBox
	Friend WithEvents Text16 As New TextBox
	Friend WithEvents Text1 As New TextBox
	Friend WithEvents Combo12 As New ComboBox
	Friend WithEvents Combo13 As New ComboBox
	Friend WithEvents Combo14 As New ComboBox
	Friend WithEvents Combo6 As New ComboBox
	Friend WithEvents Combo5 As New ComboBox
	Friend WithEvents Combo10 As New ComboBox
	Friend WithEvents Combo1 As New ComboBox
	Friend WithEvents Combo7 As New ComboBox
	Friend WithEvents Combo8 As New ComboBox
	Friend WithEvents Combo3 As New ComboBox
	Friend WithEvents Combo9 As New ComboBox
	Friend WithEvents Combo4 As New ComboBox
	Friend WithEvents Combo2 As New ComboBox
	Friend WithEvents Check10 As New CheckBox
	Friend WithEvents Check11 As New CheckBox
	Friend WithEvents Check13 As New CheckBox
	Friend WithEvents Check1 As New CheckBox
	Friend WithEvents Check2 As New CheckBox
	Friend WithEvents Check3 As New CheckBox
	Friend WithEvents Check4 As New CheckBox
	Friend WithEvents Check5 As New CheckBox
	Friend WithEvents Check6 As New CheckBox
	Friend WithEvents Picture2 As PictureBox

	Sub SaveRecord()
		Dim conn = New ADODB.Connection()
		Dim rec = New ADODB.Recordset
		conn.Open($"Provider=sqloledb;Data Source={ConnectionIP},1433;Network Library=DBMSSOCN;Initial Catalog={CAPDB}; User ID=xx;Password=xxxx")

		If DTPicker1.Value = ServerTime Then
			MessageBox.Show("You Need to enter a BirthDate", "", MessageBoxButtons.OK)
			Exit Sub
		End If

		If Not DateTime.TryParse(Text6.Text) Then
			MessageBox.Show("Your Birthdate is Incorrect.  Please adjust.", "", MessageBoxButtons.OK)
			Exit Sub
		End If

		If String.IsNullOrWhiteSpace(Text2.Text) Then
			MessageBox.Show("You Need to enter a Last Name", "", MessageBoxButtons.OK)
			Exit Sub
		End If

		If String.IsNullOrWhiteSpace(Text3.Text) Then
			MessageBox.Show("You Need to enter an First Name", "", MessageBoxButtons.OK)
			Exit Sub
		End If

		If {"CASP", "Scouting Network"}.Any(Function(x) Combo12.Text.Equals(x)) Then
			If String.IsNullOrWhiteSpace(Combo6.Text) Then
				MessageBox.Show("You Need to enter a Sub Group", "", MessageBoxButtons.OK)
				Exit Sub
			End If

			If Check10.Checked AndAlso String.IsNullOrWhiteSpace(Text11.Text) Then
				MessageBox.Show("You Need to Enter a Student ID", "", MessageBoxButtons.OK)
				Exit Sub
			End If

			If String.IsNullOrWhiteSpace(Combo13.Text) Then
				MessageBox.Show("You Need to select an Ethnicity", "", MessageBoxButtons.OK)
				Exit Sub
			End If

			GoTo Procedure1
		End If

		If String.IsNullOrWhiteSpace(Combo14.Text) Then
			MessageBox.Show("You Need to answer question regarding IDHS services", "", MessageBoxButtons.OK)
			Exit Sub
		End If

		If DTPicker2.Value = ServerTime Then
			If MessageBox.Show("Did you want to use TODAY'S DATE for your registration date?", "Add Another?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.No Then
				MessageBox.Show("Ok.  Please select a different Registration date.", "", MessageBoxButtons.OK)
				Exit Sub
			End If
		End If

		If {Check11, Check13, Check1, Check2, Check3, Check4, Check5, Check6}.All(Function(cb) Not cb.Checked) Then
			If MessageBox.Show("Is this individual a Volunteer, Youth Committee Member, Community Committee Member, Community Resident, Parent, etc?", "Additional Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
				MessageBox.Show("Please go back to the top of the form and check the appropriate box", "", MessageBoxButtons.OK)
				Exit Sub
			End If
		End If

		If Convert.ToInt32(Text6.Text) < 18 Then
			If String.IsNullOrWhiteSpace(Text8.Text) Then
				MessageBox.Show("You Need to enter a Parent/Guardian for this Individual", "", MessageBoxButtons.OK)
				Exit Sub
			End If
		End If

Procedure1:
		esql = $"select count(*) from tblOrgRegistrations where [LastName] = '{Text2.Text()}' And [FirstName] = '{Text3.Text()}' And BirthDate = '{DTPicker1.Value().ToString("mm/dd/yyyy")}' And Fiscal = {Fiscal}"
		rec.Open(esql, conn, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)

		If Not Convert.ToInt32(rec.Fields(0)) = 0 Then
			MessageBox.Show("This person is already in the database.  To avoid DUPLICATION enter a different individual or contact the CAP Administrator for further assistance.", "Duplicate Found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
			Text2.Clear()
			Text3.Clear()
			DTPicker1.Value = ServerTime
			Exit Sub
		End If

		If Not rec.EOF Then rec.MoveNext()
		rec.Close()

		esql = $"select count(*) from tblRegistrationSYAB where Text1 = '{Text2.Text()}' And Text2 = '{Text3.Text()}' And Text3 = '{DTPicker1.Value.ToString("mm/dd/yyyy")}'"
		rec.Open(esql, conn, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)

		If Not Convert.ToInt32(rec.Fields(0)) = 0 Then
			MessageBox.Show("Please enter a different individual.  This one is already in SYAB.", "Duplicate", MessageBoxButtons.OK, MessageBoxIcon.Hand)
			Text2.Clear()
			Text3.Clear()
			DTPicker1.ResetText()
			Exit Sub
		End If

		If Not rec.EOF Then rec.MoveNext()
		rec.Close()

		esql = "select GetDate()"
		rec.Open(esql, conn, CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockReadOnly)
		ServerTime = Convert.ToDateTime(rec.Fields(0))
		rec.Close()

		'Select AgencyID------------------
		esql = $"select AgencyID from tblOrgProfile where [System Name] ='{Combo12.Text()}'"
		rec.Open(esql, conn, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)

		AgencyID = Convert.ToInt32(rec!AgencyID)

		If Not rec.EOF Then rec.MoveNext()
		rec.Close()

		esql = "select * from tblOrgRegistrations"
		rec.Open(esql, conn, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)
		rec.AddNew()

		rec!Agency = Combo12.Text
		rec!AgencyID = AgencyID
		rec!RegDate = DTPicker2.Value
		rec!FirstName = Text3.Text
		rec!LastName = Text2.Text
		rec!NickName = Text5.Text
		rec!Birthdate = DTPicker1.Value
		rec!AgeReg = Text6.Text
		rec!Participant = Check10.Checked
		rec!Volunteer = Check11.Checked
		rec!YouthCommittee = Check1.Checked
		rec!Board = Check13.Checked
		rec!CommunityResident = Check2.Checked
		rec!Parentcheck = Check3.Checked
		rec!AreaProject = Check6.Checked
		rec!CAPStaff = Check5.Checked
		rec!FCCM = Check4.Checked
		rec!Sector = Combo5.Text
		rec!Gender = Combo10.Text
		rec!Address = Text19.Text
		rec!City = Text20.Text
		rec!ZIP = Text21.Text
		rec!Phone = Text7.Text
		rec!Email = Text10.Text
		rec!Race = Combo1.Text
		rec!Language = Combo7.Text
		rec!Parent = Text8.Text
		rec!EmergencyContact = Text4.Text
		rec!EmerRelationship = Text9.Text
		rec!EmerPhone = Text14.Text
		rec!EnrolledSchool = Combo8.Text
		rec!School = Text12.Text
		rec!Grade = Combo3.Text
		rec!Referral = Combo9.Text
		rec!Service = Combo4.Text
		rec!CommunityArea = Combo2.Text
		rec!EntryTime = ServerTime
		rec!Fiscal = Fiscal
		rec!SubGroup = Combo6.Text
		rec!Preparer = Text16.Text
		rec!BackgroundInfo = Text1.Text
		rec!StudentID = Text11.Text
		rec!IDHS = Combo14.Text

		If Not rec.EOF Then rec.MoveNext()
		rec.Close()

		If MessageBox.Show("Would you like to print this record?", "Print Record", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
			Me.PrintForm()
		End If

		If MessageBox.Show("Would you like to print Parent Consent Form?", "Print Form", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
			Using printImage As New CustomImagePrinterDocument(Picture2.Image)
				printImage.Print()
			End Using
		End If

		For Each [control] In Me.Controls.Cast(Of Control).Where(Function(c) TypeOf c Is TextBox)
			CType(control, TextBox).Clear()
		Next

		For Each [control] In Me.Controls.Cast(Of Control).Where(Function(c) TypeOf c Is ComboBox)
			Dim cb As ComboBox = CType(control, ComboBox)
			For Each item In cb.Items
				If String.IsNullOrWhiteSpace(item.Text) Then
					cb.SelectedIndex = cb.Items.IndexOf(item)
					Exit For
				End If
			Next
		Next

		For Each [control] In Me.Controls.Cast(Of Control).Where(Function(c) TypeOf c Is CheckBox)
			CType(control, CheckBox).Checked = False
		Next

		MessageBox.Show("The record has been sent to the database", "", MessageBoxButtons.OK)

		esql = "select GetDate()"
		rec.Open(esql, conn, CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockReadOnly)
		ServerTime = Convert.ToDateTime(rec.Fields(0))
		rec.Close()

		DTPicker1.Value = ServerTime
		DTPicker2.Value = ServerTime

		If Not DataGridOrganization = "Administrator" Then
			Combo12.Text = DataGridOrganization
		End If

		Command5.Enabled = True
	End Sub

	Private Sub PrintForm()
		Throw New NotImplementedException()
	End Sub
End Class

Public Class CustomImagePrinterDocument
	Inherits PrintDocument

	Public Property ImageToPrint() As Image = New Bitmap(0, 0)
	Public Sub New()
		MyBase.New()
	End Sub

	Public Sub New(ByVal [image] As Image)
		MyBase.New()
		ImageToPrint = [image]
	End Sub

	Protected Overrides Sub OnBeginPrint(e As PrintEventArgs)
		MyBase.OnBeginPrint(e)
	End Sub

	Protected Overrides Sub OnPrintPage(e As PrintPageEventArgs)
		MyBase.OnPrintPage(e)
		e.Graphics.DrawImage(ImageToPrint, 0, 0, 12000, 12000)
		e.HasMorePages = False
	End Sub
End Class

Open in new window

-saige-
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I'd agree with saige - you'll probably find it easier to move to VB.NET from VB6.

ASP.NET is more of the "Front end", while VB.NET (or C#) would be the language you'd use for modules and such.
0
al4629740Author Commented:
Thank you saige.  Let me study what you put.  Did you use something to put that together and is it accurate thru and thru?  This will help me.

Also once I learn to put this into VB.NET I’m a little confused on how I tie this into ASP.  

What software would I need?  Visual studio?  Anything else?
0
it_saigeDeveloperCommented:
I actually just converted by hand with some assumptions as to the types used.  For example, DataGridOrganization doesn't have a declaration.  Also it should be mentioned that most of the Control declarations would be in the designer file and not the associated form's code file.

-saige-
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.