Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Salmon King Seafood (SKS) Reference App to show some of the features of the Visual Basic Upgrade Companion tool from Mobilize.NET to migrate code from VB6 to .NET.

NotificationsYou must be signed in to change notification settings

GAPVelocityAI/SKSWinForms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SKSWinForms

About the App

Salmon King Seafood (SKS) is a reference App create to show some of the migration capabilities of theVisual Basic Upgrade CompanionVBUC fromMobilize.Net

This repo contanins the migratedSKS VB6 Version

Building the App

If you want to build this project on your development machine, just check that you match the following requirements:

sdkVersion

You can clone the repository to your machine. From the command line just run:

git clone https://github.com/MobilizeNet/SKSWinForms.git

Or you can download the code by clicking on Download ZIP

NOTE: if you download the code remember to unblock your files. When you download certain files Windows will block then forsecurity and you might get an error likeblockedResX

To fix this problem:Open the file explorer. Navigate to project/solution directorySearch for *.resx. --> You will get list of resx filesRight click the resx file, open the properties and check the option 'Unblock'Repeat #3 for each resx file.Reload the project.

Once you have downloaded the code look for SKS.sln. And open that file.When the solution is open the first thing you need to do is restore packages.One easy way to do is right click on your solution node.

Select theManage Nuget Packages for Solution... and select that option. From there you can make sure that all nugets are restored.

Once all the nugets have been restore, just rebuild and run.

Migrated Screens

Below you can see some of the migrated screens

frmOrderReceptionVB Screen

frmOrderReceptionVB Screen

frmOrderReceptionVB Screen

frmOrderReceptionVB Screen

frmOrderReceptionVB Screen

frmOrderReceptionVB Screen

frmOrderReceptionVB Screen

frmOrderReceptionVB Screen

Some VBUC Features used by this migration

ADODB toSystem.Data.Common

ConvertsADODB to ADO.Net by using the System.Data.Common libraries and some helpers.

Remarks

  • This option convertsADODB to ADO.NET by using helper classes but with a very high automation level.
  • If the VB6 code is using data binding to grids it is also recommended to convert all data grids to .Net components.

General Description:

This solution uses a set of helper objects to provide equivalent behavior in .Net and to encapsulate the ADO.Net machinery required in order to handle a set of data, more specifically for the RecordSet object, which is very powerful and flexible in VB6 and does not have a direct equivalence in .Net. The approach reduces the manual changes effort to achieve functional equivalence.

The usage ofSystem.Data.Common libraries provides the application with the ability to interact with different Database Manager Systems (e.g. SQL Server, Oracle, MS Access, etc) through its ADO.Net 2.0 compliant providers with just a minimal configuration effort and proper dialect changes.

Deployment Note

This feature if needed can be configured using a .Net configuration file containing specific sections. SeeExample

ClassMaps To
ADODB.RecordSetUpgradeHelpers.DB.ADO.ADORecordSetHelper
ADODB.CommandSystem.Data.Common.DbCommand
ADODB.CommandTypeEnumSystem.Data.CommandType
ADODB.ConnectionSystem.Data.Common.DbConnection
ADODB.DataTypeEnumSystem.Data.DbType
ADODB.FieldSystem.Data.DataColumn
ADODB.FieldsSystem.Data.DataColumnCollection
ADODB.IsolationLevelEnumSystem.Data.IsolationLevel
ADODB.ObjectStateEnumSystem.Data.ConnectionState
ADODB.ParameterSystem.Data.Common.DbParameter
ADODB.ParameterDirectionEnumSystem.Data.ParameterDirection
ADODB.ParametersSystem.Data.Common.DbParameterCollection
ADODB.StreamSystem.IO.StreamWriter
ADODB.LockTypeEnumUpgradeHelpers.DB.ADO.LockTypeEnum
ADODB.CursorLocationEnumUpgradeHelpers.DB.ADO.CursorLocationEnum
ADODB.AffectEnumUpgradeHelpers.DB.ADO.AffectEnum
ADODB.EventStatusEnumUpgradeHelpers.DB.ADO.Events.EventStatusEnum
ADODB.EventReasonEnumUpgradeHelpers.DB.ADO.Events.EventReasonEnum
ADODB.PositionEnumUpgradeHelpers.DB.ADO.PositionEnum
MSAdodcLib.AdodcUpgradeHelpers.DB.ADO.ADODataControlHelper
MSAdodcLib.EOFActionEnumUpgradeHelpers.DB.Controls.EOFActionEnum
MSAdodcLib.BOFActionEnumUpgradeHelpers.DB.Controls.BOFActionEnum

Code Examples

VB6

DimconConnectionAsNewADODB.ConnectionDimcmdCommandAsNewADODB.CommandDimrstRecordSetAsNewADODB.RecordsetconConnection.OpencmdCommand.CommandText="SELECT * FROM TestTable;"...rstRecordSet.OpenIfrstRecordSet.EOF=FalseThenMsgBoxrstRecordSet.Fields(0).Name&"="&rstRecordSet.Fields(0)ElseMsgBox"No records were returned using the query "&cmdCommand.CommandTextEndIf

C#

usingUpgradeHelpers.DB;...DbConnectionconConnection=AdoFactoryManager.GetFactory().CreateConnection();DbCommandcmdCommand=AdoFactoryManager.GetFactory().CreateCommand();ADORecordSetHelperrstRecordSet=newADORecordSetHelper("");conConnection.Open();...cmdCommand.CommandText="SELECT * FROM TestTable;";...rstRecordSet.Open();if(!rstRecordSet.EOF){MessageBox.Show(Convert.ToString(rstRecordSet[0]),Application.ProductName);}else{MessageBox.Show("No records were returned using the query "+cmdCommand.CommandText,Application.ProductName);}

MSFlexGridLib To DataGridViewFlex

Maps Microsoft'sMSFlexGridLib to a helper class that extends theSystem.Windows.Forms.DataGridView component

ClassMaps To
MSFlexGridLib.MSFlexGridUpgradeHelpers.Gui.DataGridViewFlex

VB6

PrivateSubForm_Load()DimctlAsMSFlexGridSetctl=MSFlexGrid1ctl.ScrollBars=flexScrollBarBothctl.GridLines=flexGridNoneEndSub
privatevoidForm1_Load(ObjecteventSender,EventArgseventArgs){UpgradeHelpers.Gui.DataGridViewFlexctl;ctl=newUpgradeHelpers.Gui.DataGridViewFlex();ctl.ScrollBars=ScrollBars.Both;ctl.CellBorderStyle=DataGridViewCellBorderStyle.None;}

VBCollection ToOrderedDictionary

Convert Collection type toSystem.Collections.Specialized.OrderedDictionary

ClassMaps To
vba.CollectionSystem.Collections.Specialized.OrderedDictionary

MSComctLib ToSystem.Windows.Forms

Converts Microsoft'sMSComctLib classes toSystem.Windows.Forms.

Remarks:

  • By using this option the converted application will not have any >reference to the COM Component.
ClassMaps To
MSComctlLib StatusBarSystem.Windows.Forms.StatusStrip
MSComctlLibToolbarSystem.Windows.Forms.ToolStrip
MSComctlLibImageListSystem.Windows.Forms.ImageList
MSComctlLibTabStripSystem.Windows.Forms.TabControl
MSComctlLibTreeViewSystem.Windows.Forms.TreeView
MSComctlLibImageComboSystem.Windows.Forms.ComboBox
MSComctlLibListViewSystem.Windows.Forms.ListView
MSComctLib.ProgressBarSystem.Windows.Forms.ProgressBar

VB6

BeginVB.FormForm1...BeginMSComctlLib.ImageComboImageCombo1...EndBeginMSComctlLib.SliderSlider1...EndBeginMSComctlLib.ImageListImageList1...EndBeginMSComctlLib.ListViewListView1...EndBeginMSComctlLib.TreeViewTreeView1...EndBeginMSComctlLib.ProgressBarProgressBar1...EndBeginMSComctlLib.StatusBarStatusBar1...EndBeginMSComctlLib.TabStripTabStrip1...EndBeginMSComctlLib.ToolbarToolbar1...End...

C#

partialclassForm1{   ...publicSystem.Windows.Forms.MaskedTextBoxMaskEdBox1;publicSystem.Windows.Forms.ComboBoxImageCombo1;publicSystem.Windows.Forms.TrackBarSlider1;publicSystem.Windows.Forms.ImageListImageList1;publicSystem.Windows.Forms.ListViewListView1;publicSystem.Windows.Forms.TreeViewTreeView1;publicSystem.Windows.Forms.ProgressBarProgressBar1;privateSystem.Windows.Forms.ToolStripStatusLabel_StatusBar1_Panel1;publicSystem.Windows.Forms.StatusStripStatusBar1;privateSystem.Windows.Forms.TabPage_TabStrip1_Tab1;publicSystem.Windows.Forms.TabControl.TabPageCollectionTabStrip1_Tabs;publicSystem.Windows.Forms.TabControlTabStrip1;publicSystem.Windows.Forms.ToolStripToolbar1;   ...privatevoidInitializeComponent(){      ...this.ImageCombo1=newSystem.Windows.Forms.ComboBox();this.Slider1=newSystem.Windows.Forms.TrackBar();this.ImageList1=newSystem.Windows.Forms.ImageList();this.ListView1=newSystem.Windows.Forms.ListView();this.TreeView1=newSystem.Windows.Forms.TreeView();this.ProgressBar1=newSystem.Windows.Forms.ProgressBar();this.StatusBar1=newSystem.Windows.Forms.StatusStrip();this._StatusBar1_Panel1=newSystem.Windows.Forms.ToolStripStatusLabel();this.TabStrip1=newSystem.Windows.Forms.TabControl();this.TabStrip1_Tabs=newSystem.Windows.Forms.TabControl.TabPageCollection(TabStrip1);this._TabStrip1_Tab1=newSystem.Windows.Forms.TabPage();this.Toolbar1=newSystem.Windows.Forms.ToolStrip();}

About

Salmon King Seafood (SKS) Reference App to show some of the features of the Visual Basic Upgrade Companion tool from Mobilize.NET to migrate code from VB6 to .NET.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp