Bonjour,
j'ai un problème de modification d'un champs sur une table SQL Server,
je modifie un champs "x" et un autre champs "y" de type text m'empêche de faire mon update.
mon code :
c'est un problème XML à priori, si mon champs "y" contiens \n \t ou \r ça me génère cette exception. :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 public void MaFonction(int Id, string NewValue) { MyEntities MyEnt = null; List<TABLE> MyTABLE; try { using (MyEnt = Manager.Instance.GetEntityModel(SimedApplicationConstants.MODEL) as MyEntities) { MyTABLE = (from T in MyEnt.TABLE where T.ID == Id select T).ToList<TABLE>(); if (MyTABLE.Count == 1) { MyTABLE[0].X= NewValue; rem.SaveChanges(); rem.Refresh(System.Data.Objects.RefreshMode.StoreWins, MyCoursTypes); } } }
valeur hexadécimale 0x0C, est un caractère non valide.
à System.Xml.XmlEncodedRawTextWriter.InvalidXmlChar(Int32 ch, Char* pDst, Boolean entitize)
à System.Xml.XmlEncodedRawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)
à System.Xml.XmlEncodedRawTextWriter.WriteString(String text)
à System.Xml.XmlEncodedRawTextWriterIndent.WriteString(String text)
à System.Xml.XmlWellFormedWriter.WriteString(String text)
à System.Xml.Linq.ElementWriter.WriteElement(XElement e)
à System.Xml.Linq.XElement.WriteTo(XmlWriter writer)
à System.Xml.Linq.XNode.GetXmlString(SaveOptions o)
à System.Xml.Linq.XNode.ToString()
je m'en remets à vous.
Cordialement.
ALCINA
Partager