Hola amigos he construido manualmente mi Command para mi SqlDataAdapter y
funciona muy bien para el Update y el Insert pero para el Delete no
funciona, cuando yo elimino una fila de mi DataTable lo hago mediante
DataTable.Rows.RemoveAt(Fila) ¿será por eso que no funciona?
Mi codigo del DeleteCommand es:
dap.DeleteCommand = new SqlCommand();
dap.DeleteCommand.Connection = Sistema.Conexion;
dap.DeleteCommand.CommandText = "usp_EliminarDetalleVenta";
dap.DeleteCommand.CommandType = CommandType.StoredProcedure;
dap.DeleteCommand.Parameters.Add("@DetVentasId",SqlDbType.Int);
dap.DeleteCommand.Parameters["@DetVentasId"].SourceColumn = "DetVentasId";
dap.Update(dt);
El dap.Update(dt) no me bota ningún error.
Gracias por su ayuda.
Leer las respuestas