Saturday, March 19, 2011

Katy Playground Nwe Wideo

in C sharp, delete records in an Access database (version 97) using the ODBC libraries


Here I write the ODE to modify a record using the same tools and same métdos lois that to make the insertion seus Article in C sharp, insert records into an Access database (version 97) using the ODBC libraries

As in the previous, I import the following libraries:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System . Data.OleDb;

and work in class Type.


public void Delete (Type _tipo)

{
DatosConexionABaseDeDatos DatosConexionABaseDeDatos odatosConexion = new ();
odatosConexion.getConexion OleDbConnection connection = (); eliminarSQL
string = "DELETE FROM WHERE IdTipo Type =" + _tipo.id;
conexion.Open ( )
oAdaptador OleDbDataAdapter = new OleDbDataAdapter (eliminarSQL, conn);
OleDbCommandBuilder oBuilder = new OleDbCommandBuilder (oAdaptador)

oDsTipo DataSet = new DataSet ("Type");
oAdaptador.Fill ( oDsTipo, "Type");
conexion.Close ();}


This maintains differences with the successor, as they never targeted all fields, and instead run a DELETE statement. You can save the lines where we created a Row object added as new, because obviously it does not add deleted records that already exist.




0 comments:

Post a Comment