private void btnCreateDB_Click(object sender, EventArgs e) { ConnectionString = tbArguments.Text; if (string.IsNullOrEmpty(ConnectionString)) { tbOutWindows.Text = "Please provide valid connection string or use commando : -default"; return; } try { if (tbArguments.Text.Contains("-default")) { ConnectionString = defaultDbConnectionString; dapperPlus = new DapperPlus(ConnectionString); dapperPlus.CreateDB("DefaultDapperPlusDb"); } else { dapperPlus.CreateDB("DefaultDapperPlusDb", ConnectionString); } } catch (Exception ex) { throw ex; } tbOutWindows.Text = ""; tbOutWindows.Text += $"Database with connection string : {ConnectionString} has been created"; }
public Dapper() { InitializeComponent(); this.ConnectionString = defaultDbConnectionString; dapperPlus = new DapperPlus(ConnectionString); tbOutWindows.Text = $"ConnectionString is set to default { defaultDbConnectionString}"; }