返回首页

gbase数据、南大通用产品文档:GBase8aCommandType 属性

更新日期:2024年09月11日

获取或设置一个值,指明命令的类型。

语法
[Visual Basic]
Public Overrides Property CommandType As CommandType

Get

Set
[C#]
public override CommandType CommandType { get; set; }

属性值
CommandType 可以设置的值有:

Text :SQL 文本命令(默认)


StoredProcedure :存储过程的名称;

TableDirect :表的名称。

实现
IDbCommand.CommandType

注释
当CommandType 属性设置成StoredProcedure 时, CommandText 属性应该

GBase 8a 程序员手册ADO.NET 篇


- 132 -

南大通用数据技术股份有限公司
设置为存储过程的名字。在用户调用Execute 方法的时候,这个命令就执行这
个存储过程。

示例
下面的例子创建了GBaseCommand 且设置了它的一些属性。
[Visual Basic]
Public Sub CreateGBaseCommand()
Dim gsCommand As New GBaseCommand()
gsCommand.CommandType = CommandType.Text
End Sub

[C#]
public void CreateGBaseCommand()
{
GBaseCommand gsCommand = new GBaseCommand();
gsCommand.CommandType = CommandType.Text;
}

GBaseRowUpdatingEventArgs 构造函数
初始化一个新的GBaseRowUpdatedEventArgs 类实例。

语法
[Visual Basic]



GBase 8a 程序员手册ADO.NET 篇
南大通用数据技术股份有限公司

- 321 -
Public Sub New ( _

row As DataRow, _

command As IDbCommand, _

statementType As StatementType, _

tableMapping As DataTableMapping _
)
[C#]
public GBaseRowUpdatingEventArgs(

DataRow row,

IDbCommand command,

StatementType statementType,

DataTableMapping tableMapping
)

参数
1) row :通过Update 发送的DataRow ;
2) command :当调用Update 时执行的IDbCommand ;
3) statementType :指定查询类型的StatementType 值之一 ;
4) tableMapping :通过Update 发送的DataTableMapping。

优化特性:

当a LEFT JOIN b 中,
b 表的WHERE 条件中包含有字段的非NULL 判断条
件时,LEFT JOIN 能够转换成INNER JOIN,从而提高查询优化的性能;

当a RIGHT JOIN b 中,a 表的WHERE 条件中包含有字段的非NULL 判断
条件时,RIGHT JOIN 能够转换成INNER JOIN,从而提高查询优化的性能。