当前位置: 首页>>代码示例>>C#>>正文


C# IDataReader.GetAsString方法代码示例

本文整理汇总了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;
 }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:IngresSchemaLoader.StoredProcedures.cs

示例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;
        }
开发者ID:nlhepler,项目名称:mono,代码行数:14,代码来源:MySqlSchemaLoader.StoredProcedures.cs

示例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;
 }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:19,代码来源:FirebirdSchemaLoader.Columns.cs

示例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;

        }
开发者ID:nlhepler,项目名称:mono,代码行数:21,代码来源:SqliteSchemaLoader.Constraints.cs

示例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;
 }
开发者ID:nlhepler,项目名称:mono,代码行数:22,代码来源:OracleSchemaLoader.Constraints.cs

示例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;
 }
开发者ID:nlhepler,项目名称:mono,代码行数:13,代码来源:MySqlSchemaLoader.Constraints.cs

示例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;
 }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:22,代码来源:MySqlSchemaLoader.Columns.cs

示例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;
 }
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:PgsqlSchemaLoader.Constraints.cs

示例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;
 }
开发者ID:nlhepler,项目名称:mono,代码行数:15,代码来源:PgsqlSchemaLoader.StoredProcedures.cs

示例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;
        }
开发者ID:nlhepler,项目名称:mono,代码行数:23,代码来源:PgsqlSchemaLoader.Columns.cs

示例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;
 }
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:17,代码来源:FirebirdSchemaLoader.StoredProcedures.cs


注:本文中的IDataReader.GetAsString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。