private void OnLoad(object sender, EventArgs e) { try { DBConn.Open(); SySal.OperaDb.Schema.DB = DBConn; } catch (Exception x) { DBConn.Close(); MessageBox.Show(x.Message, "Error opening DB connection!", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } try { RefreshBricksSets(); if (lvBrickSets.Items.Count != 0) { lvBrickSets.Items[0].Selected = true; GetBricksInBrickSet(lvBrickSets.SelectedItems[0].Tag.ToString()); } } catch (Exception x) { MessageBox.Show(x.Message, "Error opening DB connection!", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } }
static void Main() { OperaDbCredentials cred = OperaDbCredentials.CreateFromRecord(); OperaDbConnection conn = new OperaDbConnection(cred.DBServer, cred.DBUserName, cred.DBPassword); conn.Open(); /*frmLinkingConfig configForm = new frmLinkingConfig((long)5e15+600107, conn); * configForm.ShowDialog();*/ //long id = (new frmLinkingConfig((long)5e15+100012, conn)).Get((long)5e15+100012, conn); long id = (new frmLinkingConfig(0, conn)).Get(0, conn); // return configForm._configId; //Application.Run(new frmLinkingConfig((long)5e15+600107, conn)); //Get((long)5e15+600107, conn); }