Creating the Main Program File

Create the Program.cs file, which is the main entry point for the application.

  1. In the Solution Explorer, right-click SMP101, then select Add > New Item.
  2. In Categories, select Code and in Templates, select Code File.
  3. Name the code file Program.cs, then click Add.
    An empty code tab titled Program.cs opens.
  4. Copy the code from the Program.cs file you downloaded from the SAP Community Network (SCN) Web site, also provided below, into the Program.cs tab.
    using System;
    using SMP101Windows;
    using System.Windows.Forms;
    
    namespace SMP101Windows
    {
        static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>private static Customers _form1 = new Form1();
            private static Customers _form1 = new Customers();
            private static Customer_Details _form2 = new Customer_Details();
            private static string _custid;
            public static string getCustomer()
            {
                return _custid;
            }
            public static void setCustomer(string custid)
            {
                _custid = custid;
            }
            public static Customers getForm1()
            {
                return _form1;
            }
            public static Customer_Details getForm2()
            {
                return _form2;
            }
            static void Main(string[] args)
            {
                Application.Run(_form1);
            }
        }
    }
  5. Save your changes.
  6. Build the project by pressing Ctrl+Shift+B.