Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 (中文) » UltraLite - .NET 编程 » 了解 UltraLite.NET 开发

 

访问模式信息

Table API 中的对象表示表、列、索引和同步发布。每个对象都有一个 Schema 属性,用于访问与该对象结构相关的信息。

您无法通过 API 修改模式。只能检索关于模式的信息。

您可以访问以下模式对象和信息:

  • ULDatabaseSchema   提供数据库中表的数量和名称,以及日期和时间格式等全局属性。

    调用 ULConnection.Schema 以获取 ULDatabaseSchema 对象。请参见Schema 属性ULDatabaseSchema 类

  • ULTableSchema   表的列和索引的数量和名称。

    调用 ULTable.Schema 以获取 ULTable.Schema 对象。请参见Schema 属性ULTableSchema 类

  • ULIndexSchema   索引中列的相关信息。由于索引没有与其直接关联的数据,因此没有单独的 Index 类,而只有一个 ULIndexSchema 类。

    调用 ULTableSchema.GetIndex、ULTableSchema.GetOptimalIndex 或 ULTableSchema.GetPrimaryKey 方法以获取 ULIndexSchema 对象。请参见ULTableSchema 类ULIndexSchema 类