public VirtuosoDotNetDSNForm(String name, String connect_string) : this(name) { VirtuosoConnection c = new VirtuosoConnection(connect_string); try { string [] hp = c.GetConnectionOption("HOST").Split(":".ToCharArray()); string host, port; if (hp.Length > 1) { host = hp[0]; port = hp[1]; } else { host = "localhost"; port = "1111"; try { if (int.Parse(hp[0]) > 0) { host = "localhost"; port = hp[0]; } } catch { port = "1111"; host = hp[0]; } } this.tbHostName.Text = hp.Length > 1 ? hp[0] : "localhost"; this.tbPort.Text = hp.Length > 1 ? hp[1] : hp[0]; } catch { } try { this.tbUserID.Text = c.GetConnectionOption("UID"); } catch {} try { this.tbPwd.Text = c.GetConnectionOption("PWD"); } catch {} this.tbSourceName.Enabled = false; this.Text = "Edit Data Source"; }
public VirtuosoDotNetDSNForm(String name, String connect_string) : this(name) { VirtuosoConnection c = new VirtuosoConnection (connect_string); try { string [] hp = c.GetConnectionOption ("HOST").Split (":".ToCharArray ()); string host, port; if (hp.Length > 1) { host = hp[0]; port = hp[1]; } else { host = "localhost"; port = "1111"; try { if (int.Parse(hp[0]) > 0) { host = "localhost"; port = hp[0]; } } catch { port = "1111"; host = hp[0]; } } this.tbHostName.Text = hp.Length > 1 ? hp[0] : "localhost"; this.tbPort.Text = hp.Length > 1 ? hp[1] : hp[0]; } catch { } try { this.tbUserID.Text = c.GetConnectionOption ("UID"); } catch {} try { this.tbPwd.Text = c.GetConnectionOption ("PWD"); } catch {} this.tbSourceName.Enabled = false; this.Text = "Edit Data Source"; }