예제 #1
0
        public override string GenerateView(string spName)
        {
            try
            {
                OperationsDB oDb = new OperationsDB();
                DataSet      ds  = oDb.ExecuteProcedureToGetColumns(spName);
                return(ds.Tables[0].Rows[0][0].ToString());
            }
            catch (Exception)
            {
                return("");
            }

            //throw new NotImplementedException();
        }
예제 #2
0
        public List <SqlColumns> GetColumnNames(string spName)
        {
            OperationsDB oDb        = new OperationsDB();
            DataSet      ds         = oDb.ExecuteProcedureToGetColumns(spName);
            string       parameters = "";

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                parameters += item["ParameterName"] + "=NULL,";
            }

            parameters = parameters.Substring(0, parameters.Length - 1);
            DataSet resultSet = oDb.ExecuteSql(spName + " " + parameters);

            return(resultSet.Tables[0].Columns.Cast <DataColumn>()
                   .Select(x => new SqlColumns()
            {
                ColumnName = x.ColumnName, SqlDbType = x.DataType.Name
            })
                   .ToList());
        }