Skip to main content

Posts

Showing posts with the label c#

DatabaseAccess (Class Code in C#, C Sharp)

 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.SqlClient; using System.Data; namespace EXAMPLE SYSTEM NAME  {         public class DatabaseAccess     {         public static SqlConnection conn;         private static SqlConnection ConnOpen()         {             if(conn == null)             {                 conn = new SqlConnection(CONNECTION STRING);             }             if(conn.State!=System.Data.ConnectionState.Open)             {                 conn.Open();             }             return conn; ...

C# Windows Forms Application Tutorial with Example

So far we have seen how to work with C# to create console-based applications. But in a real-life scenario team normally use Visual Studio and C# to create either Windows Forms or Web-based applications. A windows form application is an application, which is designed to run on a computer. It will not run on a web browser because then it becomes a web application. This Tutorial will focus on how we can create Windows-based applications. We will also learn some basics on how to work with the various elements of the C# Windows application. In this Windows tutorial, you will learn- Windows Forms Basics A Windows forms application is one that runs on a desktop computer. A Windows forms application will normally have a collection of controls such as labels, textboxes, list boxes, etc. In our examples, we will look at working the Microsoft SQL Server as our database. For learning purposes, one can download and use the  Microsoft SQL Server Express Edition , which is a free database softwar...