Bonjour,Hope that ça va !!!
voila je vous expose mon probléme :
dans une BD j'ai créé une table Contact avec un champs ID qui doit s'auto incrémenter alors j'ai mis la spécification du compteur a Oui et ainsi le champs (est d'identité) = oui mais quand j'execute mon code j'ai l'erreur suivante :
Impossible d'insérer une valeur explicite dans la colonne identité de la table 'Contact' quand IDENTITY_INSERT est défini à OFF. pourtant le champs est d'identité est à oui ???!
voici ma fonction d'insertion :
public void insert(string nomc , string prenomc ,string E_mail,string tel_fix ,string tel_port)
{
init();
Contact.Contact nco = new Contact.Contact { nom = nomc, prenom = prenomc, email = E_mail, Telfixe= tel_fix, Telportable = tel_port };
contact.InsertOnSubmit(nco);
db.SubmitChanges();
Console.WriteLine("insertion terminé");
}
l'erreur surviens a la ligne de db.SubmitChanges();
donc je ne comprend plus rien !
merci pour votre aide![]()
Partager