|
using System;
namespace Primeworks.CeDb
{
/// <summary>
/// A CE property database table (a database in API terminology)
/// </summary>
public class CeDbTable
{
private CeDbVolume m_volume;
private string m_strName;
private int m_nFlags;
private int m_oid = 0;
public CeDbTable(CeDbVolume volume, string strName, int nFlags)
{
m_volume = volume;
m_strName = strName;
m_nFlags = nFlags;
}
public CeDbTable(CeDbVolume volume, string strName)
{
m_volume = volume;
m_strName = strName;
m_nFlags = 0;
}
public CeDbRecordSet Open(CeDbOpenFlags flags, uint propid)
{
IntPtr hTable = IntPtr.Zero;
CEGUID ceguid = m_volume.CeGuid;
hTable = CeDbApi.CeOpenDatabaseEx(ref ceguid, ref m_oid, m_strName, propid, (uint)flags, IntPtr.Zero);
if((int)hTable != -1)
return new CeDbRecordSet(hTable);
throw new CeDbException("Failed to open table");
}
public string Name
{
get { return m_strName; }
}
public int Flags
{
get { return m_nFlags; }
}
public int Id
{
get
{
return m_oid;
}
}
}
/// <summary>
/// Database open flags
/// </summary>
public enum CeDbOpenFlags : uint
{
None = 0,
AutoIncrement = 1
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I work on R&D for Frotcom International, a company that develops web-based fleet management solutions.