VistaDB 6
VistaDB.Provider Namespace / VistaDBCommand Class / ExecuteNonQuery Method
Example


In This Topic
    ExecuteNonQuery Method
    In This Topic
    Executes a SQL statement against a connection object. 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()

    Return Value

    The number of rows affected.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