jueves, 7 de mayo de 2015

DEscarga MASIVA CFDI

Aqui tienen la aportacion que hemos realizado varios.
podran descargar el codigo si, asi lo desean.

http://www.lawebdelprogramador.com/foros/Visual-Basic.NET/1478397-Descarga-Masiva-XML-SAT.html#i1495133

saludos.

Delete LINQ to SQL and One-To-Many Relationships

Según el respectivo idioma les saldrá este error:

An attempt was made to remove a relationship between a ParentTable and a ChildTable. However, one of the relationship’s foreign keys (ChildTable.parent_id) cannot be set to null.

…ó el siguiente:

Se ha intentado quitar una relación entre TablaPadre y TablaHija, pero una de las claves externas de la relación (TablaHija.nIdPadre) no se puede establecer en null.

In order to be able to delete a child row independently in the database when calling SubmitChanges(), we must indicate DeleteOnNull="true" on this association. Unfortunately the only way to change this is to drop out of the designer and make the change manually in the .dbml file. Luckily, however, you can switch back to the designer and it will not remove this attribute if you continue to modify the model as long as you don't remove the entities entirely. Once we make this change we can now delete just a single Order from the grid and save normally:



The other option to fix this issue is to modify the Delete Rule to "Cascade" on the relationship in the database. In that case the designer correctly infers this attribute on the association. This may be a better solution if you want to always automatically delete the related orders when a customer is deleted in your database no matter what application is working against the data. Additionally, if you apply the Cascade delete rule on your database relationship, then you will not have to manually delete the children first every time the parent is deleted when working with the DataContext. (Note: To enable cascading deletes, just right click on the parent table in the Server Explorer, select "Open Table Definition", right-click on any column and select "Relationships", select the relation and expand the "INSERT and UPDATE Specification" then for the Delete Rule set it to CASCADE.)