Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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);
                }
            }
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: textbox center align winform 
Csharp :: Find Number of Repetitions of Substring 
Csharp :: c# unzip all archive files inside directory 
Csharp :: how to store more precise data then float c# 
Csharp :: temp^late php table for mysql 
Csharp :: using mediamanager how to play mp3 files 
Csharp :: C# WriteLine() and Write() 
Csharp :: EntityFramework: using tables in different scemas 
Csharp :: @using System,System.Core 
Csharp :: nullable 
Csharp :: c# string .contains against empty string returns 
Csharp :: osk c# 
Csharp :: openiddect ef core table not creating 
Csharp :: C# console out restore 
Csharp :: keep sprites at fixed transform according to screen resolution unity 
Csharp :: id dublication exception c# .net core 
Csharp :: input string was not in a correct format convert to double 
Csharp :: creating weighted graph in c# 
Csharp :: c# linq foreach example 
Csharp :: c# change chart legend font size 
Csharp :: serenity.is required field 
Csharp :: how to add a round image unity 
Csharp :: c# read only file used by other app 
Csharp :: ExpandoObject Make Objects Extensible 
Csharp :: mac osx enable hidpi terminal 
Csharp :: c# extension method in non static class 
Csharp :: wcf service dependency injection 
Csharp :: Make a variable public without showing in the inspector 
Csharp :: c# operators 
Csharp :: unity c# bool to int conversion 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =