本文整理汇总了C#中Mono.Data.Sqlite.SqliteDataReader.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# SqliteDataReader.Dispose方法的具体用法?C# SqliteDataReader.Dispose怎么用?C# SqliteDataReader.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Data.Sqlite.SqliteDataReader
的用法示例。
在下文中一共展示了SqliteDataReader.Dispose方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HyenaSqliteArrayDataReader
internal HyenaSqliteArrayDataReader (SqliteDataReader reader)
{
rows = new List<object[]> ();
column_names = new Dictionary<string, int> ();
closed = false;
current_row = -1;
ReadAllRows (reader);
reader.Dispose ();
}
示例2: 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;
}
示例3: GetItemData
static public ItemData GetItemData(int id)
{
string query = "SELECT * FROM ITEM where id = " + id;
reader = ExecuteQuery(query);
ItemData item = new ItemData();
if (reader.Read())
{
item.id = reader.GetInt32(0);
item.name = reader.GetString(1);
item.addHp = reader.GetFloat(2);
item.addAttack = reader.GetFloat(3);
item.addDefence = reader.GetFloat(4);
item.addGold = reader.GetInt32(5);
}
reader.Dispose();
return item;
}
示例4: ConvertDataReaderToDataSet
public DataSet ConvertDataReaderToDataSet(SqliteDataReader reader, string[] sColNames)
{
DataSet dataSet = new DataSet();
try
{
// DataTable schemaTable = reader.GetSchemaTable();
DataTable dataTable = new DataTable();
for (int i = 0; i < sColNames.Length; i++)
{
string columnName = sColNames[i];
DataColumn column = new DataColumn(columnName);
dataTable.Columns.Add(column);
}
//for (int i = 0; i <= schemaTable.Rows.Count - 1; i++)
//{
// DataRow dataRow = schemaTable.Rows[i];
// string columnName = dataRow["ColumnName"].ToString();DataColumn column = new DataColumn(columnName, dataRow["DataType"].GetType());
// dataTable.Columns.Add(column);
//}
dataSet.Tables.Add(dataTable);
int j = 0;
while (reader.Read())
{
DataRow dataRow = dataTable.NewRow();
for (int i = 0; i < sColNames.Length; i++)
{
dataRow[i] = reader.GetValue(i);
}
j++;
dataTable.Rows.Add(dataRow);
}
reader.Dispose();
}
catch (Exception ex)
{
string sMsg = ex.Message.ToString();
}
return dataSet;
}