Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimized way to transfer from String to StringBuilder
Message
De
05/02/2014 12:56:20
 
 
À
05/02/2014 12:39:37
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01593079
Message ID:
01593300
Vues:
26
>>>>Out of curiosity : can you provide an example of the input string ?
>>>
>>>An example of an input string is usually a SQL select such as:
>>>
>>>SELECT Member.FirstName,Member.LastName,Member.Bann,Member.Register,Member.Blog,Member.Cie,Member.NoProvince,
>>> Province.Title_E AS Province,Country.Title_E AS Country,Member.City,Member.NoCountry,Member.Http,Member.LastAccess
>>> FROM Member (NOLOCK)
>>> LEFT JOIN Province ON Member.NoProvince=Province.Numero
>>> INNER JOIN Country ON Member.NoCountry=Country.Numero
>>> WHERE Member.Numero=@Numero
>>
>>I'm being dumb. If, in the context of your code snippet, that is lcString then what is lcWord. Or, more simply - what would the required output look like?
>
>lcString is as shown above. lcWord is a variable holding a reserved word from SQL Server. So, I have a list of reserved word. This is why there is a For/Next loop where lcWord is changing all the time. So, the For/Next loop scans each word to see if they are in the string. If they are, they will be adjusted with [Table] or [Field] for example.

So wouldn't this do the same thing:
lcString = lcString.Replace(lcWord + ".", "[" + lcWord + "].")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform