Ejemplo n.º 1
0
       private string GetConnection()
       {
           try
           {
               ConnectionDetails Con = new ConnectionDetails();
               return Con.readConnection();
           }
           catch (Exception ex)
           {
               return "";
           }

       }
Ejemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ConnectionDetails Con = new ConnectionDetails();
            string ConnectionString = Con.readConnection();


            try
            {
                using (var ctx = new ItrackContext())
                {

                    Debug.WriteLine(ConnectionString);
                    ctx.Database.Connection.ConnectionString = ConnectionString;
                    // MessageBox.Show("Connection String Is -" + ctx.Database.Connection.ConnectionString);
                    var group = new List<Group>
            {
                new Group { GroupName ="Vougue Tex",Address="address",TeleNo="077426888" ,FaxNo="011252325",GroupID="VT" }
              
            };

                 

           

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Enable title bar skinning 
            DevExpress.Skins.SkinManager.EnableFormSkins();
            Application.Run(new UI.frmMain());

                    
                  //  new ItrackContextInitializer().InitializeDatabase(ctx);
                }
            }
            catch (Exception ex)
            {
             
         
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //Configuration config = new Configuration();
                //config.ShowDialog();
            }


        }