Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Practices - SQL Strings
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Best Practices - SQL Strings
Divers
Thread ID:
00841144
Message ID:
00841144
Vues:
54
What are the best practices for fromatting a string to submit to a SQL Server? In the past I used code like the following:
Public Function sqlText(ByRef str As String) As String
On Error GoTo ErrHandler


    If IsNull(str) Or Len(str) = 0 Then
        sqlText = "''"
    Else
        sqlText = "'" & str & "'"
    End If

End Function
Is there a better way to handle this now? What about boolean and datetimes?

Thanks,

Jason
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform