i had this code but the connection didnt work why?
please help me
or could be the insert had a error....
public void insertar(strBases info)
{ OleDbConnection databaseConnection = new OleDbConnection(oleDbConnectionString);
string strSQLStatement = "INSERT INTO DBO.Empresapig (id_empresa, nom_empresa, num_tarjeta, cons_prom_mensual, porce_financiacion, comision_intercambio, comision_vendedor, fondo_premiacion, costo_financiamiento, porcentaje_mora, tasa_interes_mensual,gasto_operacion, costo_plastico, embozado, letra_cambio, logo_marca, prospectacion, procesamiento, consulta_infobot, alquiler_datafono, impresion_estado, envio_email) " +
info.id_emp + "','" + info.nombre_emp + "','" + info.n_tarjetas + "','" + info.consumo_prom + "','" + info.porcentaje_f + "','" + info.comision_inter + "','" + info.comision_ven + "','" + info.fondo_pre + "','" + info.costo_fin + "','" + info.porc_mora + "','" + info.tasa_intmens + "','" + info.gas_operacion + "','" + info.cos_plastico + "','" + info.embozado + "','" + info.letcontrato +
"','" + info.logo_marc + "','" + info.prospec + "','" + info.procesa + "','" + info.con_infobot + "','" + info.alq_data + "','" + info.id_emp + "','" + info.imp_formulario + "','" + info.envio_correo + ";";
OleDbCommand databaseCommand = new OleDbCommand(strSQLStatement, databaseConnection);
databaseCommand.CommandType = CommandType.Text;
try
{ databaseConnection.Open();
int numRows = databaseCommand.ExecuteNonQuery();
}
catch (Exception e)
{ Console.WriteLine("****** Caught an exception:\n{0}",
e.Message);
}
finally
{
databaseConnection.Close();
}
}
please help me
or could be the insert had a error....
public void insertar(strBases info)
{ OleDbConnection databaseConnection = new OleDbConnection(oleDbConnectionString);
string strSQLStatement = "INSERT INTO DBO.Empresapig (id_empresa, nom_empresa, num_tarjeta, cons_prom_mensual, porce_financiacion, comision_intercambio, comision_vendedor, fondo_premiacion, costo_financiamiento, porcentaje_mora, tasa_interes_mensual,gasto_operacion, costo_plastico, embozado, letra_cambio, logo_marca, prospectacion, procesamiento, consulta_infobot, alquiler_datafono, impresion_estado, envio_email) " +
info.id_emp + "','" + info.nombre_emp + "','" + info.n_tarjetas + "','" + info.consumo_prom + "','" + info.porcentaje_f + "','" + info.comision_inter + "','" + info.comision_ven + "','" + info.fondo_pre + "','" + info.costo_fin + "','" + info.porc_mora + "','" + info.tasa_intmens + "','" + info.gas_operacion + "','" + info.cos_plastico + "','" + info.embozado + "','" + info.letcontrato +
"','" + info.logo_marc + "','" + info.prospec + "','" + info.procesa + "','" + info.con_infobot + "','" + info.alq_data + "','" + info.id_emp + "','" + info.imp_formulario + "','" + info.envio_correo + ";";
OleDbCommand databaseCommand = new OleDbCommand(strSQLStatement, databaseConnection);
databaseCommand.CommandType = CommandType.Text;
try
{ databaseConnection.Open();
int numRows = databaseCommand.ExecuteNonQuery();
}
catch (Exception e)
{ Console.WriteLine("****** Caught an exception:\n{0}",
e.Message);
}
finally
{
databaseConnection.Close();
}
}