Porting a Winforms-application from Win7&VB6 to Win10 & C#.NET

Inki

-
Joined
Aug 24, 2020
Messages
11
Location
Stockholm
Programming Experience
10+
My background is Java, I am new to C# and the .NET-platform

I am about to transform a Windows7/VB6 application to a Windows10 C#.NET (or VB.net)-application.
I have downloaded ‘Visual Studio 2019’, using .NET version 4.8.
The application is a Standalone/Winforms-application, with roughly 6 forms (uses an SQL-server) .
The application is a classic CRUD-application; you store data, you update the data, you delete data and you have various ways of retrieving data (filtered on one or more fields)

I have not written that VB6-application myself, the program is written by enthusiasts back in the days to handle a burning situation - not so many best-practices are used.

I have 2 questions I would like to get your input on; the first is more abstract and the other is more specific. Either your input and advice - or good/thorough book(s), course online (getting a bit tired of courses leaving out bits and pieces though ...)



  1. I would like to use the OO-facilitates of the .NET framework, making the code readable/maintainable (structure and best-practices) handle the db-connection in the correct manner for all the involved forms (fetching the db-connection from a class or a property-file) , creating a package/module of functions/methods …
  2. The application has a ‘print’-functionality where a PDF is created using 'Crystal Report'( I think), So a PDF must be created here as well (and some tool/program where I can handle layout, I have done some work with Jasperreports back in the days for Java …) – So, what PDF functionality can I use now , is there something similar to Crystal report or Japserreports available ?


Best, i
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
2,120
Location
Chesapeake, VA
Programming Experience
10+
I would like to use the OO-facilitates of the .NET framework, making the code readable/maintainable (structure and best-practices) handle the db-connection in the correct manner for all the involved forms (fetching the db-connection from a class or a property-file) , creating a package/module of functions/methods …
Since you already know Java, then it's just a matter of familiarizing yourself with what's available in C# and the .NET Framework. docs.microsoft.com should be your guide for this. (If you were still on the learning curve of learning how to program, then C# programming books will benefit you more.) In general, if you follow SOLID object oriented principles in Java, also apply the same practices as you write code in C#. The first few months, your code may look like Java that was transliterated into C#, but if you supplement your learning by reviewing other peoples code, or skimming through referencesources.microsoft.com you'll stop doing the stringA.Equals(stringB) and start writing stringA == stringB, and you'll be using real property getters/setters (e.g. int Foo { get; set; } instead of getFoo()/setFoo()).
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
2,120
Location
Chesapeake, VA
Programming Experience
10+
The application has a ‘print’-functionality where a PDF is created using 'Crystal Report'( I think), So a PDF must be created here as well (and some tool/program where I can handle layout, I have done some work with Jasperreports back in the days for Java …) – So, what PDF functionality can I use now , is there something similar to Crystal report or Japserreports available ?
Crystal Reports is still around as a company. Their library may not be in the box anymore, but it's still something that you can still use.
 
Top Bottom