本文整理汇总了C#中IDataReader.GetAsString方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetAsString方法的具体用法?C# IDataReader.GetAsString怎么用?C# IDataReader.GetAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataReader
的用法示例。
在下文中一共展示了IDataReader.GetAsString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadProcedure
protected virtual DataStoredProcedure ReadProcedure(IDataReader rdr)
{
DataStoredProcedure procedure = new DataStoredProcedure();
int field = 0;
procedure.procedure_name = rdr.GetAsString(field++);
procedure.procedure_owner = rdr.GetAsString(field++);
procedure.text_segment = rdr.GetAsString(field++);
return procedure;
}
示例2: ReadProcedure
DataStoredProcedure ReadProcedure(IDataReader rdr)
{
DataStoredProcedure procedure = new DataStoredProcedure();
int field = 0;
procedure.db = rdr.GetAsString(field++);
procedure.name = rdr.GetAsString(field++);
procedure.type = rdr.GetAsString(field++);
procedure.specific_name = rdr.GetAsString(field++);
procedure.param_list = rdr.GetString(field++); // for some obscure reasons, GetAsString() doesn't work
procedure.returns = rdr.GetAsString(field++);
procedure.body = rdr.GetString(field++);
return procedure;
}
示例3: ReadColumn
protected virtual IDataTableColumn ReadColumn(IDataReader rdr)
{
var column = new DataTableColumn();
int field = 0;
column.TableSchema = rdr.GetAsString(field++);
column.TableName = rdr.GetAsString(field++).Trim();
column.ColumnName = rdr.GetAsString(field++).Trim();
column.Nullable = rdr.GetAsBool(field++);
column.SqlType = rdr.GetAsString(field++).Trim();
column.Generated = rdr.GetAsBool(field++);
//column.Unsigned = column.FullType.Contains("unsigned");
column.PrimaryKey = rdr.GetAsBool(field++);
column.Length = rdr.GetAsNullableNumeric<long>(field++);
column.Precision = rdr.GetAsNullableNumeric<int>(field++);
column.Scale = rdr.GetAsNullableNumeric<int>(field++);
column.DefaultValue = rdr.GetAsString(field++);
FormatFullType(column);
return column;
}
示例4: ReadConstraint
protected virtual DataConstraint ReadConstraint(IDataReader rdr, string table)
{
DataConstraint t = new DataConstraint();
const int K_ID = 0;
//const int K_SEQ = 1;
const int K_TABLE = 2;
const int K_FROM = 3;
const int K_TO = 4;
t.TableSchema = "main";
t.ReferencedTableSchema = "main";
t.ConstraintName = "fk_" + table + "_" + rdr.GetAsNumeric<int>(K_ID).ToString();
t.TableName = table;
t.ColumnName = rdr.GetAsString(K_FROM);
t.ReferencedTableName = UnquoteSqlName(rdr.GetAsString(K_TABLE));
t.ReferencedColumnName = rdr.GetAsString(K_TO);
return t;
}
示例5: ReadTrigger
protected virtual DataConstraint ReadTrigger(IDataReader rdr)
{
var constraint = new DataConstraint();
int field = 0;
constraint.ConstraintName = rdr.GetAsString(field++);
constraint.TableSchema = rdr.GetAsString(field++);
constraint.TableName = rdr.GetAsString(field++);
constraint.ConstraintType = "T";
string body = rdr.GetAsString(field++);
//BEGIN
// IF (:new."EmployeeID" IS NULL) THEN
// SELECT Employees_seq.NEXTVAL INTO :new."EmployeeID" FROM DUAL;
// END IF;
//END;
string expression, column;
if (MatchTrigger(TriggerMatch1, body, out expression, out column))
{
constraint.ColumnNames.Add(column.Trim('"'));
constraint.Expression = expression;
}
return constraint;
}
示例6: ReadConstraint
protected virtual DataConstraint ReadConstraint(IDataReader rdr)
{
DataConstraint constraint = new DataConstraint();
int field = 0;
constraint.ConstraintName = rdr.GetAsString(field++);
constraint.TableSchema = rdr.GetAsString(field++);
constraint.TableName = rdr.GetAsString(field++);
constraint.ColumnName = rdr.GetAsString(field++);
constraint.ReferencedTableSchema = rdr.GetAsString(field++);
constraint.ReferencedTableName = rdr.GetAsString(field++);
constraint.ReferencedColumnName = rdr.GetAsString(field++);
return constraint;
}
示例7: ReadColumn
protected virtual IDataTableColumn ReadColumn(IDataReader rdr)
{
var column = new DataTableColumn();
int field = 0;
column.TableSchema = rdr.GetAsString(field++);
column.TableName = rdr.GetAsString(field++);
column.ColumnName = rdr.GetAsString(field++);
string nullableStr = rdr.GetAsString(field++);
column.Nullable = nullableStr == "YES";
column.SqlType = rdr.GetAsString(field++);
var extra = rdr.GetAsString(field++);
column.Generated = extra == "auto_increment";
column.FullType = FormatFullType(rdr.GetAsString(field++));
column.Unsigned = column.FullType.Contains("unsigned");
string columnKey = rdr.GetAsString(field++);
column.PrimaryKey = columnKey == "PRI";
column.Length = rdr.GetAsNullableNumeric<long>(field++);
column.Precision = rdr.GetAsNullableNumeric<int>(field++);
column.Scale = rdr.GetAsNullableNumeric<int>(field++);
column.DefaultValue = rdr.GetAsString(field++);
return column;
}
示例8: ReadForeignConstraint
protected virtual DataForeignConstraint ReadForeignConstraint(IDataReader rdr)
{
var t = new DataForeignConstraint();
int field = 0;
t.ConstraintName = rdr.GetAsString(field++);
t.TableName = rdr.GetAsString(field++);
t.ConstraintType = rdr.GetAsString(field++);
t.ReferencedTableSchema = rdr.GetAsString(field++);
t.ReferencedTableName = rdr.GetAsString(field++);
t.ColumnName = rdr.GetAsString(field++);
return t;
}
示例9: ReadProcedure
protected virtual DataStoredProcedure ReadProcedure(IDataReader rdr)
{
DataStoredProcedure procedure = new DataStoredProcedure();
int field = 0;
procedure.proowner = rdr.GetAsNumeric<long>(field++);
procedure.proname = rdr.GetAsString(field++);
procedure.proretset = rdr.GetAsBool(field++);
procedure.prorettype = rdr.GetAsNumeric<long>(field++);
procedure.formatted_prorettype = rdr.GetAsString(field++);
procedure.proargtypes = rdr.GetAsString(field++);
procedure.proallargtypes = rdr.GetAsString( field++);
procedure.proargnames = rdr.GetAsString(field++);
procedure.proargmodes = rdr.GetAsString(field++);
return procedure;
}
示例10: ReadColumn
protected virtual IDataTableColumn ReadColumn(IDataReader rdr)
{
var column = new DataTableColumn();
int field = 0;
column.TableSchema = rdr.GetAsString(field++);
column.TableName = rdr.GetAsString(field++);
column.ColumnName = rdr.GetAsString(field++);
string nullableStr = rdr.GetAsString(field++);
column.Nullable = nullableStr == "YES";
column.SqlType = rdr.GetAsString(field++);
var domain_schema = rdr.GetAsString(field++);
var domain_name = rdr.GetAsString(field++);
column.DefaultValue = GetColumnDefaultValue(rdr.GetAsString(field++));
column.Generated = column.DefaultValue != null && column.DefaultValue.StartsWith("nextval(");
column.Length = rdr.GetAsNullableNumeric<long>(field++);
column.Precision = rdr.GetAsNullableNumeric<int>(field++);
column.Scale = rdr.GetAsNullableNumeric<int>(field++);
column.FullType = GetColumnFullType(domain_name, domain_schema, column);
return column;
}
示例11: ReadProcedure
DataStoredProcedure ReadProcedure(IDataReader rdr)
{
DataStoredProcedure procedure = new DataStoredProcedure();
int field = 0;
procedure.TableSchema = rdr.GetAsString(field++);
procedure.Name = rdr.GetAsString(field++).Trim();
procedure.Type = rdr.GetAsString(field++);
procedure.ParameterName = rdr.GetAsString(field++).Trim();
procedure.IsOutputParameter = rdr.GetAsBool(field++);
procedure.ParameterType = rdr.GetAsString(field++).Trim();
procedure.Length = rdr.GetAsNullableNumeric<long>(field++);
procedure.Precision = rdr.GetAsNullableNumeric<int>(field++);
procedure.Scale = rdr.GetAsNullableNumeric<int>(field++);
procedure.DefaultValue = rdr.GetAsString(field++);
procedure.BodyContainsSelectStatement = rdr.GetAsBool(field++);
return procedure;
}