SCSIraidGURU’s World

C# Windows Forms Code

I have been working on learning C#. I have coded in Basic, Advance Basic, Pascal, Turbo Pascal, C++, Cobol, Fortran, and other languages over 20+ years. My favorite was Turbo Pascal. A 3.5″ floppy with TPC.EXE and notepad. With the new tools available to programmers no wonder why code is so bloated and like spaghetti. We learned to program on limited hardware with only notepad and a compiler. I remember doing punch cards at Macomb Community College

9.4.2015: Chapter 12: XML Programming. Finally getting into writing code that works in .NET.

I removed the height variable from the CSS file. This was done to allow the elastic measurements to work properly. The height variable caused the data in the boxes to overflow.

11.1.2015 Started working in Windows Forms. Created two applications

2D Multiplication Table

Simple calculator

Started application in C#

Top 100 C# Interview Questions and Answers from a4academics.com

Abstract Class versus Interface from Code Project


11.25.2015: Created my first SQL based application in Windows Forms

12.6.2015: I have not moved these commands into the windows frame version yet. Still working on the syntax. I wanted to figure out all the SQL commands that can be used in C#

 

I took courses 20+ years ago on C++. So learning C# would not be difficult. I downloaded Visual C# 2010 and 2013 Studio. I found C# is extremely easy because much of the work is done for you. The libraries are more robust. Many of the programs we wrote by hand like sorting arrays are now actual functions. I belong to the IEEE and IEEE Computer Society. The IEEE Computer Society has thousands of books and courses on their site to use. I found a book on C#. I have used many of the books and courses to learn from over the last 20 years of membership. It was a benefit of my B.EE. We were all signed up as students. I consider it continuing education.

I take the examples from the books to learn the syntax and then rewrite based on how I did it in the past. I program old school examples to learn coding. My first example is a 2D multiplication table.

2D Multiplication X * Y

It is a simple 2D array with header column and row.

Improved Multiplication Table using var multiplied

Next item on my list of Windows Form programming. This is a simple 2D multiplication table app. It can display up to 15 x 15. It is due to the box size. Windows form version has not been programmed for validation yet. I am planning on this in the near future. It does remove the value after generate.

2D Multiplication Table in Windows Form Installer

I created a simple math calculator. It can do +, -, *, /, and power of two numbers. It can display each individually or all of them. This was a simple program for a Windows Form. I figured out how to use a textbox to display multiple lines.

Simple Calculator in Windows Form Installer

This is the next phase of Ann’s age clock. It refreshed every 250ms. It calcuates her age down to seconds. The next phase of this will be figuring out how to get it into ASP.NET.

Ann’s age clock Installer

This is an example of an Abstract Class with its output. One of the questions my wife was asked during several interviews is what is the difference between an interface and abstract class.

Abstract Class Example and Output

 

This SQL Class will alter a table named Workout and add notes field

SQL Command: Alter table Workout

This SQL Class will create a table named Workout

SQL Command: Create Table Workout

This SQL Class will drop a table named Workout

SQL Command: Drop Table Workout

This SQL Class will accomplishes several tasks public static void sqlinsert(out Int32 numrows): Adds data to the first Workout table
public static void sqlinsertWPF(out Int32 numrows): Adds data to the second version of Workout Table with partialfullreps column

SQL Command: INSERT INTO methods

public static void AddColumnToMiddle(): Creates table workoutupdate with partialfullreps column that will be renamed to workout later.
public static void InsertIntoNewTable(): This takes data from Workout and moves it into Workoutupdate with the new column PartialFullReps

public static void DropOldRenameNew(): This drops the old table Workout and renames WorkoutUpdate to Workout with the new column

public static void SetPartialFullRepsValue(): This determines if the work out was full (15 reps) or partial (0 – 14 reps)

SQL Commands: INSERT INTO Workoutupdate from Workout Commands: DROP TABLE and RENAME TABLE

Close Menu