Example #1
0
        int MSOracleClient()
        {
            System.Data.OracleClient.OracleConnectionStringBuilder connBuilder = new System.Data.OracleClient.OracleConnectionStringBuilder();
            connBuilder.DataSource         = txtDataSource.Text.Trim();
            connBuilder.UserID             = txtUserId.Text.Trim();
            connBuilder.Password           = txtPwd.Text.Trim();
            connBuilder.LoadBalanceTimeout = 60;
            connBuilder.MinPoolSize        = 0;
            connBuilder.MaxPoolSize        = 50;

            int rows = 0;

            using (System.Data.OracleClient.OracleConnection conn = new System.Data.OracleClient.OracleConnection(connBuilder.ConnectionString))
            {
                //System.Data.OracleClient.OracleConnection conn = new System.Data.OracleClient.OracleConnection(connBuilder.ConnectionString);
                System.Data.OracleClient.OracleCommand cmd = conn.CreateCommand();
                cmd.CommandText    = txtSql.Text.Trim();
                cmd.CommandTimeout = 300;
                //cmd.ResetCommandTimeout();

                conn.Open();
                using (System.Data.OracleClient.OracleDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        object[] objs = new object[500];
                        dr.GetValues(objs);
                        rows++;
                    }
                }

                return(rows);
            }
        }
Example #2
0
 public override int GetValues(object[] values)
 {
     return(rdr.GetValues(values));
 }