Delete with OdbcCommand - CSharp Database

CSharp examples for Database:ODBC

Description

Delete with OdbcCommand

Demo Code


using System.Data.Odbc;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//  w  w w . j  ava 2 s  .co  m

public class Main{
        internal static void DeleteSymbolPerformance()
        {
            OdbcConnection con = new OdbcConnection(Constants.MyConString);

            try
            {

                OdbcCommand com = new OdbcCommand("DELETE from symbolperformance", con);


                con.Open();
                com.ExecuteNonQuery();
                log.Info("\nData deleted from symbolperformance table....... \n");

                con.Close();

            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
            finally
            {
                if (con != null)
                    con.Close();
            }
        }
}

Related Tutorials