martes, 15 de septiembre de 2009

Type 'Microsoft.VisualBasic.PowerPacks.LineShape' is not defined.

Technology: Microsoft Visual Basic (migration from VB6.0 to .NET)

Problem: After migrating a VB6.0 to a .NET one, I get the error "Type 'Microsoft.VisualBasic.PowerPacks.LineShape' is not defined". in a machine that does not have the SP1 of VS 2008. After installing power packs 3.0 and restarting the app, I still get the same error

Solution: Download and add reference to power packs 2 ( Microsoft.VisualBasic.PowerPacks.dll ) aparently power pack 3 does not sustitute power pack 2

viernes, 11 de septiembre de 2009

Linq To SQL: Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to OFF

Technology: LinQ to SQL

Problem: When inserting a record using LinQ to SQL in a table that has properly defined a column with an autogenerated ID, on submit linq to sql will thow the error:

Linq To SQL: Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to OFF

This problem appeared when i was trying to delete all records of a relationship, and adding new ones.
The relationship table had an Id column, which was not set

Solution:
Apparently, linq to sql "mixed" the old records that i deleted with the new ones, so I solved the problem calling "submitChanges" after deleting the records of the relationship and before adding the new ones.