Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
返回指定列的列 ID。
Public Function GetColumnID(ByVal name As String) As Short
public short GetColumnID(string name)
name 列的名称。
指定列的列 ID。
ULException 类 发生 SQL 错误。
列 ID 的范围是从 0 到 ColumnCount-1(含 0 和 ColumnCount-1)。
结果集中并非所有列都有名称,并且并非所有列名都是唯一的。如果没有使用别名,非计算列的名称将以其所属表的名称为前缀。例如,MyTable.ID 是查询 "SELECT ID FROM MyTable" 返回的结果集中仅有的一列的名称。
列 ID 和计数在模式升级过程中可能会发生变化。为了正确地标识列,请按名称访问它,或者在模式升级后刷新高速缓存中的 ID 和计数。