Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparing Data Row column values and string values
Message
 
 
À
10/07/2013 11:39:45
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01578028
Message ID:
01578110
Vues:
40
BTW, I re-checked that method (you helped with it a while ago) and it doesn't trim
/*========================================================================================
       *                Dictionary<String, String> ToSQML
       *=======================================================================================*/
      /// <summary>
      /// Populates a <string, string> dictionary using a SQML string.    
      /// </summary>
      /// <param name="tDictionary"></param>
      /// <param name="tcSQML"></param>
      public static void PopulateFromSQML(this Dictionary<String, String> tDictionary, String tcSQML)
      {
         tDictionary.Clear();

         String pattern = @"<(?<field>[^/>]+)>(?<data>.*)</\k<field>>";

         MatchCollection matches = Regex.Matches(tcSQML, pattern, RegexOptions.Singleline);
         foreach (Match m in matches)
         {
            if (!tDictionary.ContainsKey(m.Groups["field"].ToString()))
               tDictionary.Add(m.Groups["field"].ToString(), m.Groups["data"].ToString());
         }
      }
So, we can keep trim.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform