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 the SUP101 project, then select New Item.
  2. In Templates, select Code File.
  3. Name the code file Program.cs, then click Add.
  4. Right-click Program.cs, then select View Code.
  5. Replace the existing code with the code from the Program.cs file you downloaded from the Sybase Product Documentation Web site:
    using System;
    using SUP101;
    using System.Windows.Forms;
    
    
    namespace SUP101
    {
        static class Program
        {
            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;
            }
    
            //Customer list screen
            public static Customers getForm1()
            {
                return _form1;
            }
    
            //Customer detail screen
            public static Customer_details getForm2()
            {
                return _form2;
            }
    
            static void Main(string[] args)
            {
                Application.Run(_form1);
            }
        }
    }
    
  6. Save your changes.
  7. Build the project by pressing Control+Shift+B.