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


C# SqliteDataReader.Read方法代码示例

本文整理汇总了C#中Mono.Data.Sqlite.SqliteDataReader.Read方法的典型用法代码示例。如果您正苦于以下问题:C# SqliteDataReader.Read方法的具体用法?C# SqliteDataReader.Read怎么用?C# SqliteDataReader.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Data.Sqlite.SqliteDataReader的用法示例。


在下文中一共展示了SqliteDataReader.Read方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InsertMonsters

    public void InsertMonsters()
    {
        string[] nombres = SaveMonster.GetMonsterList();
        Monstruo temp;

        if (PlayerPrefs.GetString ("botonPresionado") == "new") {
            DeleteMonsters();
        }

        for(int i = 0;i < nombres.Length;++i){
            temp = SaveMonster.LoadMonster(nombres[i]);
            _query="SELECT * FROM tablaMonstruos WHERE owner='PEPE' and name='"+temp.nombre+"'";
            _command = _conexion.CreateCommand ();
            _command.CommandText = _query;
            _reader = _command.ExecuteReader ();
            int cont=0;
            if(_reader != null){
                while(_reader.Read()){
                    cont++;
                }
                if(cont!=0){
                    _query= "UPDATE tablaMonstruos set specie='"+temp.especie+"',exp='"+temp.exp.ToString()+"',modStats='"+temp.modStats.ToString()+"',estado='"+temp.estado.ToString()+"' WHERE owner='PEPE' and name='"+temp.nombre+"'";
                }else{
                    _query = "INSERT INTO tablaMonstruos VALUES('"+temp.nombre+"','"+temp.especie+"','"+temp.exp.ToString()+"','"+temp.modStats.ToString()+"','"+temp.estado.ToString()+"','PEPE')";
                }

            }
            _command = _conexion.CreateCommand();
            _command.CommandText = _query;
            _command.ExecuteReader();
        }
    }
开发者ID:Lex92,项目名称:Programacion-3,代码行数:32,代码来源:dbConection.cs

示例2: Sync

 internal void Sync(long rowid)
 {
   IsValid = false;
   _command.Parameters[0].Value = rowid;
   _reader = _command.ExecuteReader();
   _reader.Read();
 }
开发者ID:REALTOBIZ,项目名称:mono,代码行数:7,代码来源:SQLiteKeyReader.cs

示例3: DataReaderToList

        /// <summary>
        /// 转换实体
        /// </summary>
        /// <param name="read">OleDbDataReader</param>
        /// <returns>TermInfo</returns>
        private static List<StatisticsInfo> DataReaderToList(SqliteDataReader read)
        {
            List<StatisticsInfo> list = new List<StatisticsInfo>();
            while (read.Read())
            {
                StatisticsInfo _site = new StatisticsInfo();

                _site.PostCount = Convert.ToInt32(read["PostCount"]);
                _site.CommentCount = Convert.ToInt32(read["CommentCount"]);
                _site.VisitCount = Convert.ToInt32(read["VisitCount"]);
                _site.TagCount = Convert.ToInt32(read["TagCount"]);

                list.Add(_site);
            }
            read.Close();
            return list;
        }
开发者ID:azraelrabbit,项目名称:LoachsMono,代码行数:22,代码来源:Statistics.cs

示例4: GetMonsterData

 static public MonsterData GetMonsterData(int id)
 {
     string query = "SELECT * FROM MONSTER where id = " + id;
     reader = ExecuteQuery(query);
     MonsterData monster = new MonsterData();
     if (reader.Read())
     {
         monster.id = reader.GetInt32(0);
         monster.name = reader.GetString(1);
         monster.hp = reader.GetFloat(2);
         monster.attack = reader.GetFloat(3);
         monster.defence = reader.GetFloat(4);
         monster.gold = reader.GetInt32(5);
     }
     reader.Dispose();
     return monster;
 }
开发者ID:shuitian,项目名称:pokemon_rpg,代码行数:17,代码来源:Sql.cs

示例5: DataReaderToListSite

        /// <summary>
        /// 转换实体
        /// </summary>
        /// <param name="read">SqliteDataReader</param>
        /// <returns>TermInfo</returns>
        private static List<StatisticsInfo> DataReaderToListSite(SqliteDataReader read)
        {
            var list = new List<StatisticsInfo>();
            while (read.Read())
            {
                var site = new StatisticsInfo
                               {
                                   PostCount = Convert.ToInt32(read["PostCount"]),
                                   CommentCount = Convert.ToInt32(read["CommentCount"]),
                                   VisitCount = Convert.ToInt32(read["VisitCount"]),
                                   TagCount = Convert.ToInt32(read["TagCount"])
                               };

                list.Add(site);
            }
            read.Close();
            return list;
        }
开发者ID:robotbird,项目名称:jqpress-aspx,代码行数:23,代码来源:SiteData.cs

示例6: ParseToUser

        internal bool ParseToUser(SqliteDataReader reader)
        {
            bool success = false;

            if (reader.HasRows)
            {
                reader.Read();

                // Follow the SQL -> Data object
                username = reader.GetString(0);
                password = reader.GetString(1);
                fullName = reader.GetString(2);
                dateJoined = reader.GetDateTime(3);

                success = true;
            }

            return success;
        }
开发者ID:pablok2,项目名称:Fridge,代码行数:19,代码来源:UserDefinition.cs

示例7: ReadFullTable

    public ArrayList ReadFullTable(string tableName)
    {
        string query = "SELECT * FROM " + tableName;

        databaseCommand = databaseConnection.CreateCommand();
        databaseCommand.CommandText = query;

        reader = databaseCommand.ExecuteReader();

        ArrayList readArray = new ArrayList();
        while (reader.Read())
        {
            ArrayList lineArray = new ArrayList();
            for (int i = 0; i < reader.FieldCount; i++)
            {
                lineArray.Add(reader.GetValue(i));
            }
            readArray.Add(lineArray);
        }
        return readArray;
    }
开发者ID:automaticoo,项目名称:UnityEditorProject,代码行数:21,代码来源:DatabaseAcces.cs

示例8: InitCards

        private static void InitCards(SQLiteDataReader reader)
        {
            while (reader.Read())
            {
                int id = reader.GetInt32(0);
                CardData card = new CardData(id)
                {
                    AliasId = reader.GetInt32(1),
                    Type = reader.GetInt32(2),
                    Level = reader.GetInt32(3),
                    Race = reader.GetInt32(4),
                    Attribute = reader.GetInt32(5),
                    Atk = reader.GetInt32(6),
                    Def = reader.GetInt32(7),
                    Name = reader.GetString(8),
                    Description = reader.GetString(9)
                };
                m_cards.Add(id, card);

            }
        }
开发者ID:duelqiuqiu,项目名称:DevBot,代码行数:21,代码来源:CardsManager.cs

示例9: DataReaderToUserList

        /// <summary>
        /// 数据转换
        /// </summary>
        /// <param name="read"></param>
        /// <returns></returns>
        private List<UserInfo> DataReaderToUserList(SqliteDataReader read)
        {
            List<UserInfo> list = new List<UserInfo>();
            while (read.Read())
            {
                UserInfo _userinfo = new UserInfo();
                _userinfo.UserId = Convert.ToInt32(read["UserId"]);
                _userinfo.Type = Convert.ToInt32(read["Type"]);
                _userinfo.UserName = Convert.ToString(read["UserName"]);
                _userinfo.Name = Convert.ToString(read["Name"]);
                _userinfo.Password = Convert.ToString(read["Password"]);
                _userinfo.Email = Convert.ToString(read["Email"]);
                _userinfo.SiteUrl = Convert.ToString(read["SiteUrl"]);
                _userinfo.AvatarUrl = Convert.ToString(read["AvatarUrl"]);
                _userinfo.Description = Convert.ToString(read["Description"]);
                _userinfo.Displayorder = Convert.ToInt32(read["Displayorder"]);
                _userinfo.Status = Convert.ToInt32(read["Status"]);
                _userinfo.PostCount = Convert.ToInt32(read["PostCount"]);
                _userinfo.CommentCount = Convert.ToInt32(read["CommentCount"]);
                _userinfo.CreateDate = Convert.ToDateTime(read["CreateDate"]);

                list.Add(_userinfo);
            }
            read.Close();
            return list;
        }
开发者ID:jango2015,项目名称:LoachsMono,代码行数:31,代码来源:User.cs

示例10: checkOutTimedetailID

        public override int checkOutTimedetailID(string name, string starttime)
        {
            try {
                sqlite_cmd = sqlite_conn.CreateCommand ();
                sqlite_cmd.CommandText = "SELECT id FROM tbl_timedetail WHERE name ='"+name+"' AND starttime='"+starttime+"'";
                sqlite_conn.Open ();
                datareader = sqlite_cmd.ExecuteReader ();

                int readID = 0;

                while (datareader.Read())
                {
                    readID = datareader.GetInt16(0);
                }
                sqlite_conn.Close ();
                return readID;
            }
            catch (Exception ex)
            {
                sqlite_conn.Close ();
                return 0;
            }
        }
开发者ID:Bischi,项目名称:personalManager,代码行数:23,代码来源:SQLiteConnection.cs

示例11: readWorkerID

        public override int readWorkerID(string fname, string lname, string village, string hnr, string email)
        {
            try {
                sqlite_cmd = sqlite_conn.CreateCommand ();
                sqlite_cmd.CommandText = "SELECT id FROM tbl_worker WHERE fname= '"+fname+"' AND lname= '"+lname+"'AND village= '"+village+"' AND hnr= '"+hnr+"' AND email= '"+email+"'";
                sqlite_conn.Open ();
                datareader = sqlite_cmd.ExecuteReader ();

                int readID = 0;

                while (datareader.Read())
                {
                    readID = datareader.GetInt16(0);
                }
                sqlite_conn.Close ();
                return readID;
            }
            catch (Exception ex)
            {
                sqlite_conn.Close ();
                return 0;
            }
        }
开发者ID:Bischi,项目名称:personalManager,代码行数:23,代码来源:SQLiteConnection.cs

示例12: readTyp

        public override List<string> readTyp()
        {
            try {

                sqlite_cmd = sqlite_conn.CreateCommand ();

                sqlite_cmd.CommandText = "SELECT name FROM tbl_typ";

                sqlite_conn.Open ();

                datareader = sqlite_cmd.ExecuteReader ();

                string readname = "";
                List<string> typs = new List<string>(); // To Save typs and return them

                while (datareader.Read())
                {
                    readname = datareader.GetString(0);
                    typs.Add (readname);
                }
                sqlite_conn.Close ();
                return typs;
            }
            catch (Exception ex)
            {
                sqlite_conn.Close ();
                return null;
            }
        }
开发者ID:Bischi,项目名称:personalManager,代码行数:29,代码来源:SQLiteConnection.cs

示例13: readTasks

        public override List<string> readTasks(int areaID)
        {
            try {

                sqlite_cmd = sqlite_conn.CreateCommand ();

                sqlite_cmd.CommandText = "SELECT DISTINCT name FROM tbl_task inner join tbl_workplace on tbl_task.id = tbl_workplace.fk_task WHERE tbl_workplace.fk_area="+areaID+"";

                sqlite_conn.Open ();

                datareader = sqlite_cmd.ExecuteReader ();

                string readname = "";
                List<string> tasks = new List<string>(); // To Save tasks and return them

                while (datareader.Read())
                {
                    readname = datareader.GetString(0);
                    tasks.Add (readname);
                }
                sqlite_conn.Close ();
                return tasks;
            }
            catch (Exception ex)
            {
                sqlite_conn.Close ();
                return null;
            }
        }
开发者ID:Bischi,项目名称:personalManager,代码行数:29,代码来源:SQLiteConnection.cs

示例14: DataReaderToListTag

        /// <summary>
        /// 转换实体
        /// </summary>
        /// <param CateName="read">SqliteDataReader</param>
        /// <param name="read"></param>
        /// <returns>TagInfo</returns>
        private static List<TagInfo> DataReaderToListTag(SqliteDataReader read)
        {
            var list = new List<TagInfo>();
            while (read.Read())
            {
                var tag = new TagInfo
                              {
                                  TagId = Convert.ToInt32(read["categoryid"]),
                                  CateName = Convert.ToString(read["CateName"]),
                                  Slug = Convert.ToString(read["Slug"]),
                                  Description = Convert.ToString(read["Description"]),
                                  SortNum = Convert.ToInt32(read["SortNum"]),
                                  PostCount = Convert.ToInt32(read["PostCount"]),
                                  CreateTime = Convert.ToDateTime(read["CreateTime"])
                              };
                //  tag.Type = Convert.ToInt32(read["Type"]);

                list.Add(tag);
            }
            read.Close();
            return list;
        }
开发者ID:robotbird,项目名称:jqpress-aspx,代码行数:28,代码来源:TagData.cs

示例15: DataReaderToListLink

        /// <summary>
        /// 转换实体
        /// </summary>
        /// <param LinkName="read">SqliteDataReader</param>
        /// <param name="read"></param>
        /// <returns>LinkInfo</returns>
        private static List<LinkInfo> DataReaderToListLink(SqliteDataReader read)
        {
            var list = new List<LinkInfo>();
            while (read.Read())
            {
                var link = new LinkInfo
                               {
                                   LinkId = Convert.ToInt32(read["Linkid"]),
                                   Type = Convert.ToInt32(read["Type"]),
                                   LinkName = Convert.ToString(read["LinkName"]),
                                   LinkUrl = Convert.ToString(read["LinkUrl"]),
                                   Target = Convert.ToString(read["Target"]),
                                   Description = Convert.ToString(read["Description"]),
                                   SortNum = Convert.ToInt32(read["SortNum"]),
                                   Status = Convert.ToInt32(read["Status"]),
                                   CreateTime = Convert.ToDateTime(read["CreateTime"])
                               };
                if (read["Position"] != DBNull.Value)
                {
                    link.Position = Convert.ToInt32(read["Position"]);
                }

                list.Add(link);
            }
            read.Close();
            return list;
        }
开发者ID:robotbird,项目名称:jqpress-aspx,代码行数:33,代码来源:LinkData.cs


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