本文整理汇总了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();
}
}
示例2: Sync
internal void Sync(long rowid)
{
IsValid = false;
_command.Parameters[0].Value = rowid;
_reader = _command.ExecuteReader();
_reader.Read();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}