ExecuteNonQuery Method
Executes a SQL statement against a connection object.
Syntax
'Declaration Public Overrides NotOverridable Function ExecuteNonQuery() As System.Integer
'Usage Dim instance As VistaDBCommand Dim value As System.Integer value = instance.ExecuteNonQuery()
public override System.int ExecuteNonQuery()
public function ExecuteNonQuery(): System.Integer; override;
public override function ExecuteNonQuery() : System.int;
public: System.int ExecuteNonQuery(); override
public: System.int ExecuteNonQuery(); override
Return Value
The number of rows affected.
Example
The following example insert new row with using parameters
public void InsertRow(VistaDBConnection connection, long id_Customer) { VistaDBCommand command = new VistaDBCommand(); command.Connection = connection; command.CommandText = "INSERT INTO Orders (ID_Customer) VALUES (@ID_Customer)"; command.Parameters.Add("@ID_Customer", id_Customer); command.ExecuteNonQuery(); }
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also