OleDbCommand.ExecuteNonQuery() : OleDbCommand « System.Data.OleDb « C# / C Sharp by API






OleDbCommand.ExecuteNonQuery()

  


using System;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;

class MainClass
{
  static void Main(string[] args)
    {
        string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\Northwind.mdb";
        OleDbConnection conn = new OleDbConnection(ConnectionString);

    conn.Open();
    OleDbCommand cmd = new OleDbCommand("Customers", conn);


    cmd.CommandText = @"DELETE * FROM Customers";

    cmd.ExecuteNonQuery();
          
        conn.Close();                  
    }
}

   
    
  








Related examples in the same category

1.new OleDbCommand(String SQL)
2.OleDbCommand.ExecuteReader
3.OleDbCommand.ExecuteScalar
4.OleDbCommand.Transaction