public SQLServerSessionDetails(SQLServerConnection connection)
        {
            InitializeComponent();
            this.dbConnection = connection;
            SqlConnection databaseConnection = connection.getDatabaseConnection();
            String query = "SELECT spid, hostname, db_name(dbid) as DatabaseName, loginame, cmd, status "
                           + "FROM master.dbo.sysprocesses "
                           + "WHERE program_name = 'ORACLE-SQL-SERVER-CLIENT'"
                           + "AND db_name(dbid) = '"
                           + this.dbConnection.getDatabaseConnection().Database + "'";
            SqlCommand command = new SqlCommand(query, databaseConnection);
            SqlDataReader reader;
            command.CommandText = query;
            command.CommandType = CommandType.Text;
            reader = command.ExecuteReader();

            while (reader.Read())
            {
                this.sessionListing.Rows.Add("SPID", reader["spid"]);
                this.sessionListing.Rows.Add("HOST", reader["hostname"]);
                this.sessionListing.Rows.Add("DATABASE", reader["DatabaseName"]);
                this.sessionListing.Rows.Add("USER", reader["loginame"]);
                this.sessionListing.Rows.Add("COMMAND", reader["cmd"]);
                this.sessionListing.Rows.Add("STATUS", reader["status"]);
            }
            reader.Close();
        }
        private void ConnectionButton_Click(object sender, EventArgs e)
        {
            if (this.ConnectionDetails1.Text == "Server Name")
            {
                SQLServerConnection databaseConnection = new SQLServerConnection(this.ConnectionDetailsText1.Text,
                    this.ConnectionDetailsText2.Text, this.ConnectionDetailsText3.Text, this.ConnectionDetailsText4.Text);
                String result = databaseConnection.createConnection();
                MessageBox.Show(result);
                SqlConnection dbConnection = databaseConnection.getDatabaseConnection();
                if (result == "Connection Established. Press OK to continue.")
                {
                    new SQLServerView(databaseConnection).Show();
                    this.Dispose();
                }

            }
            else
            {
                OracleDBConnection databaseConnection = new OracleDBConnection(this.ConnectionDetailsText1.Text,
                    this.ConnectionDetailsText2.Text, this.ConnectionDetailsText4.Text);
                String result = databaseConnection.createConnection();
                MessageBox.Show(result);
                if (result == "Connection Established. Press OK to continue.")
                {
                    new OracleView(databaseConnection).Show();
                    this.Dispose();
                }
            }
        }
 public SQLServerDllIndex(String tableName, SQLServerConnection connection, bool option)
 {
     InitializeComponent();
     this.tableName = tableName;
     this.dbConnection = connection;
     this.Text = tableName + "@" + dbConnection.getDatabaseConnection().Database;
     refreshInitialize();
 }
 public procedureViewerSQLServer(String procedureName, SQLServerConnection connection, bool option)
 {
     InitializeComponent();
     this.procedureName = procedureName;
     this.dbConnection = connection;
     this.Text = procedureName + "@" + dbConnection.getDatabaseConnection().Database;
     refreshInitialize();
 }
 public SQLServerView(SQLServerConnection connection)
 {
     InitializeComponent();
     this.dbConnection = connection;
     refreshInitialize();
 }