Answers for "Jeng InitDb"

C#
0

Jeng InitDb

public static void InitDb()
        {
            retry:
            try
            {
                //check in first time add default data
                //add fist employee
                if (Kt.Db.Count<Models.Employee>() == 0)
                    Kt.Db.Save(<Model Here>);

            }
            catch (Exception)
            {
                //connection faile show db options
                Kimtoo.DbManager.Connections.Show();
                try
                {
                    var db = Kt.Db;

                }
                catch (Exception err)
                {
                    if (MessageBox.Show(err.Message, "CONNECTON ERROR", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning) == DialogResult.Retry)
                        goto retry;
                    Environment.Exit(0);
                }
            }
        }
Posted by: Guest on January-28-2022

C# Answers by Framework

Browse Popular Code Answers by Language