public bool AddParameter(SPField Parameter) { foreach (SPField parm in this.parameters) { if (parm.PARAMETER_NAME.ToUpper().Trim() == Parameter.PARAMETER_NAME.ToUpper().Trim()) { return(false); } } this.parameters.Add(Parameter); return(true); }
private void FillProcSchemaTable(StoreProcedure storeProcedure, DataTable schemaProcTable) { storeProcedure.Parameters.Clear(); foreach (DataRow dr in schemaProcTable.Rows) { SPField spField = new SPField(); FillProcSchemaField(spField, dr); storeProcedure.AddParameter(spField); } //添加创建命令代码 storeProcedure.CreateCmdText = GetObjectCreateText(storeProcedure.Name); }
private void FillProcSchemaTable(StoreProcedure storeProcedure, DataTable schemaProcTable) { storeProcedure.Parameters.Clear(); foreach (DataRow dr in schemaProcTable.Rows) { SPField spField = new SPField(); FillProcSchemaField(spField, dr); storeProcedure.AddParameter(spField); } //��Ӵ���������� storeProcedure.CreateCmdText = GetObjectCreateText(storeProcedure.Name); }
private void FillProcSchemaField(SPField spField, DataRow schemaDataRow) { spField.SPECIFIC_CATALOG = (schemaDataRow["SPECIFIC_CATALOG"] is DBNull) ? null : (String)schemaDataRow["SPECIFIC_CATALOG"]; spField.SPECIFIC_SCHEMA = (schemaDataRow["SPECIFIC_SCHEMA"] is DBNull) ? null : (String)schemaDataRow["SPECIFIC_SCHEMA"]; spField.SPECIFIC_NAME = (schemaDataRow["SPECIFIC_NAME"] is DBNull) ? null : (String)schemaDataRow["SPECIFIC_NAME"]; spField.ORDINAL_POSITION = (schemaDataRow["ORDINAL_POSITION"] is DBNull) ? null : (int?)schemaDataRow["ORDINAL_POSITION"]; spField.PARAMETER_MODE = (schemaDataRow["PARAMETER_MODE"] is DBNull) ? null : (String)schemaDataRow["PARAMETER_MODE"]; spField.IS_RESULT = (schemaDataRow["IS_RESULT"] is DBNull) ? null : (String)schemaDataRow["IS_RESULT"]; spField.AS_LOCATOR = (schemaDataRow["AS_LOCATOR"] is DBNull) ? null : (String)schemaDataRow["AS_LOCATOR"]; spField.PARAMETER_NAME = (schemaDataRow["PARAMETER_NAME"] is DBNull) ? null : (String)schemaDataRow["PARAMETER_NAME"]; spField.DATA_TYPE = (schemaDataRow["DATA_TYPE"] is DBNull) ? null : (String)schemaDataRow["DATA_TYPE"]; spField.CHARACTER_MAXIMUM_LENGTH = (schemaDataRow["CHARACTER_MAXIMUM_LENGTH"] is DBNull) ? null : (Int32?)schemaDataRow["CHARACTER_MAXIMUM_LENGTH"]; spField.CHARACTER_OCTET_LENGTH = (schemaDataRow["CHARACTER_OCTET_LENGTH"] is DBNull) ? null : (Int32?)schemaDataRow["CHARACTER_OCTET_LENGTH"]; spField.COLLATION_CATALOG = (schemaDataRow["COLLATION_CATALOG"] is DBNull) ? null : (String)schemaDataRow["COLLATION_CATALOG"]; spField.COLLATION_SCHEMA = (schemaDataRow["COLLATION_SCHEMA"] is DBNull) ? null : (String)schemaDataRow["COLLATION_SCHEMA"]; spField.COLLATION_NAME = (schemaDataRow["COLLATION_NAME"] is DBNull) ? null : (String)schemaDataRow["COLLATION_NAME"]; spField.CHARACTER_SET_CATALOG = (schemaDataRow["CHARACTER_SET_CATALOG"] is DBNull) ? null : (String)schemaDataRow["CHARACTER_SET_CATALOG"]; spField.CHARACTER_SET_SCHEMA = (schemaDataRow["CHARACTER_SET_SCHEMA"] is DBNull) ? null : (String)schemaDataRow["CHARACTER_SET_SCHEMA"]; spField.CHARACTER_SET_NAME = (schemaDataRow["CHARACTER_SET_NAME"] is DBNull) ? null : (String)schemaDataRow["CHARACTER_SET_NAME"]; spField.NUMERIC_PRECISION = (schemaDataRow["NUMERIC_PRECISION"] is DBNull) ? null : (Byte?)schemaDataRow["NUMERIC_PRECISION"]; spField.NUMERIC_PRECISION_RADIX = (schemaDataRow["NUMERIC_PRECISION_RADIX"] is DBNull) ? null : (Int16?)schemaDataRow["NUMERIC_PRECISION_RADIX"]; spField.NUMERIC_SCALE = (schemaDataRow["NUMERIC_SCALE"] is DBNull) ? null : (Int32?)schemaDataRow["NUMERIC_SCALE"]; spField.DATETIME_PRECISION = (schemaDataRow["DATETIME_PRECISION"] is DBNull) ? null : (Int16?)schemaDataRow["DATETIME_PRECISION"]; spField.INTERVAL_TYPE = (schemaDataRow["INTERVAL_TYPE"] is DBNull) ? null : (String)schemaDataRow["INTERVAL_TYPE"]; spField.INTERVAL_PRECISION = (schemaDataRow["INTERVAL_PRECISION"] is DBNull) ? null : (Int16?)schemaDataRow["INTERVAL_PRECISION"]; }
public bool RemoveParameter(SPField Parameter) { return this.parameters.Remove(Parameter); }
public bool AddParameter(SPField Parameter) { foreach (SPField parm in this.parameters) { if (parm.PARAMETER_NAME.ToUpper().Trim() == Parameter.PARAMETER_NAME.ToUpper().Trim()) { return false; } } this.parameters.Add(Parameter); return true; }
public bool RemoveParameter(SPField Parameter) { return(this.parameters.Remove(Parameter)); }