| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OTSModelSharp.DTLBase
- {
- public class CSQLiteQuery : IDBQueryBase
- {
- private System.Data.SQLite.SQLiteDataReader reader;
-
- public CSQLiteQuery(System.Data.SQLite.SQLiteDataReader a_reader)
- {
- reader = a_reader;
- }
- public void Close()
- {
- reader.Close();
- }
- public byte[] GetColBlobValue(int a_nColIndex, int a_nLen)
- {
- byte[] val = new byte[a_nLen];
-
- reader.GetBytes(a_nColIndex, 0, val, 0, a_nLen);
-
- return val;
- }
- public int GetColCount()
- {
- return reader.FieldCount;
- }
- public double GetColFloatValue(int a_nColIndex, double a_dNullValue = 0)
- {
- return reader.GetDouble(a_nColIndex);
- }
- public int GetColIntValue(int a_nColIndex, int a_nNullValue)
- {
- return reader.GetInt32(a_nColIndex);
- }
- public string GetColName(int a_nColIndex)
- {
- return reader.GetName(a_nColIndex);
- }
- public string GetColStringValue(int a_nColIndex, string a_sNullValue = "")
- {
- return reader.GetString(a_nColIndex);
- }
- public Type GetColType(int a_nColIndex)
- {
- return reader.GetFieldType(a_nColIndex);
-
-
- }
- public string GetColValue(int a_nColIndex)
- {
- return (string)reader.GetValue(a_nColIndex);
- }
- public bool IsColNull(int a_nColIndex)
- {
- return reader.IsDBNull(a_nColIndex);
-
- }
- public bool IsEOF()
- {
- return !reader.HasRows;
- }
- public bool IsValid()
- {
- return !reader.IsClosed;
- }
- public bool NextRow()
- {
- reader.Read();
- return true;
- }
- }
- }
|