예제 #1
0
 internal void Add(SqlSpInfo sqlSpInfo)
 {
     this.m_Sps.Add(sqlSpInfo);
 }
예제 #2
0
        // Methods
        internal SqlSpParamInfo(SqlSpInfo spInfo, DataRow row)
        {
            this.StoredProc = spInfo;
            this.Name = (string)row["COLUMN_NAME"];
            this.Type = (string)row["TYPE_NAME"];
            switch (((short)row["COLUMN_TYPE"]))
            {
              case 1:
            this.Direction = ParameterDirection.Input;
            break;

              case 2:
            this.Direction = ParameterDirection.Output;
            break;

              case 3:
            this.Direction = ParameterDirection.InputOutput;
            break;

              case 5:
            this.Direction = ParameterDirection.ReturnValue;
            break;
            }
            this.Precision = (int)row["PRECISION"];
            this.Length = (int)row["LENGTH"];
            object obj2 = row["SCALE"];
            this.Scale = (obj2 is DBNull) ? ((short)(-1)) : ((short)obj2);
            this.AllowsNull = ((short)row["NULLABLE"]) != 0;
            this.Position = (int)row["ORDINAL_POSITION"];
            object obj3 = row["COLUMN_DEF"];
            this.DefaultValue = (obj3 is DBNull) ? string.Empty : ((string)obj3);
        }
예제 #3
0
 internal void GetSqlSpInfo()
 {
     SqlCommand selectCommand = new SqlCommand("sp_stored_procedures", this.SqlConn);
     selectCommand.CommandType = CommandType.StoredProcedure;
     DataSet dataSet = new DataSet();
     new SqlDataAdapter(selectCommand).Fill(dataSet, "StoredProcs");
     this.m_StoredProcs = new SqlSpInfoArray();
     foreach (DataRow row in dataSet.Tables[0].Rows)
     {
       SqlSpInfo sqlSpInfo = new SqlSpInfo(this, row);
       this.m_StoredProcs.Add(sqlSpInfo);
     }
 }