안녕하세요. "동시성 위반 updatecommand가 예상 한 1 개의 레코드 중 0 개에 영향을줍니다." 오류 행을 업데이 트하는 동안 이상한 일은 행을 한 번에 업데이트 할 수 있다는 것과 다음 번에 동일한 행에 대한 프로세스를 반복합니다. 오류을 얻었습니다. 이미 endinit 및 tryit thingys를 테스트했습니다. 감사하겠습니다!동시성 행을 두 번째로 업데이트하는 중 오류가 발생했습니다. C#
나는 C# 및 MySQL의 이노을 사용하고
string cs = "server=" + fidaConfig.dtBDConfig.Rows[0][2] + ";user id=root;Password=" + fidaConfig.dtBDConfig.Rows[0][4] + ";persist security info=True;database=facturas";
MySql.Data.MySqlClient.MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection() { ConnectionString = cs };
switch (tableInvoice)
{
case "factura_idj":
dsLuiscencioTableAdapters.factura_idjTableAdapter idjAdapter = new Control_Administrativo.dsLuiscencioTableAdapters.factura_idjTableAdapter() { Connection = conn };
dsLuiscencio.factura_idjDataTable idj = idjAdapter.GetData();
var facturaidj = (from f in idj where f.no_factura_idj == InvoiceNumber select f).Single();
if (DateTime.Today.Date >= Convert.ToDateTime("01-01-2010") && facturaidj.fecha.Date <= Convert.ToDateTime("01-01-2010"))
{
var quieresactualizar = MessageBox.Show("Desea Actualizar el total de acuerdo a los nuevos impuestos?", "Reforma Fiscal", MessageBoxButtons.YesNo);
if (quieresactualizar == DialogResult.Yes)
{
switch (facturaidj.opt_iva)
{
case 1:
facturaidj.iva = 0;
facturaidj.total = facturaidj.subtotal;
break;
case 2:
facturaidj.iva = facturaidj.subtotal * 0.11;
facturaidj.total = facturaidj.subtotal * 1.11;
break;
case 3:
facturaidj.iva = facturaidj.subtotal * 0.16;
facturaidj.total = facturaidj.subtotal * 1.16;
break;
default:
break;
}
Number2Letter.Number2Letter n2l = new Number2Letter.Number2Letter();
string totalwithnocents = n2l.Numero2Letra(facturaidj.total.ToString(), 0, 0, "peso", "",
Number2Letter.Number2Letter.eSexo.Masculino,
Number2Letter.Number2Letter.eSexo.Masculino).ToUpper();
string strtotalconivaretenido = Math.Round(facturaidj.total, 2, MidpointRounding.ToEven).ToString("###########.00");
string cents = strtotalconivaretenido.Substring(strtotalconivaretenido.IndexOf(".") + 1);
facturaidj.total_letra = string.Format(@"{0} {1}/100 {2}", totalwithnocents, cents, facturaidj.tipo_moneda).ToUpper();
idj.EndInit();
idjAdapter.Update(facturaidj);//this runs only the first time on a row, then throws the error
}
}
break;
continues......
코드 게시 – CSharpAtl
MyISAM 또는 InnoDB를 사용하고 있습니까? – CSharpAtl
테이블 어댑터가 업데이트 한 후 행에 업데이트되는 것이 있습니까?방아쇠처럼? – mlsteeves