Пример #1
0
 static int GetDataTypeName(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         System.Data.Common.DbDataReader obj = (System.Data.Common.DbDataReader)ToLua.CheckObject(L, 1, typeof(System.Data.Common.DbDataReader));
         int    arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         string o    = obj.GetDataTypeName(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #2
0
        private void BuildSchemaInfo()
        {
            int count = _reader.FieldCount;

            string[] fieldnames = new string[count];
            for (int i = 0; i < count; ++i)
            {
                fieldnames[i] = _reader.GetName(i);
            }
            ADP.BuildSchemaTableInfoTableNames(fieldnames);

            SchemaInfo[] si = new SchemaInfo[count];
            for (int i = 0; i < si.Length; i++)
            {
                SchemaInfo s = new SchemaInfo();
                s.name     = _reader.GetName(i);
                s.type     = _reader.GetFieldType(i);
                s.typeName = _reader.GetDataTypeName(i);
                si[i]      = s;
            }

            _schemaInfo      = si;
            _fieldNameLookup = new FieldNameLookup(_reader, -1);
        }
Пример #3
0
        private static ColumnMetadata[] GetTableMetadata(DbDataReader reader)
        {
            var columnMetadata = new ColumnMetadata[reader.FieldCount];

            for (var i = 0; i < reader.FieldCount; i++)
            {
                columnMetadata[i] =
                    new ColumnMetadata(
                        reader.GetName(i), reader.GetDataTypeName(i), reader.GetFieldType(i));
            }

            return columnMetadata;
        }