This product is not supported for your selected Datadog site. ().
Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
usingSystem.Xml;classMyClass{publicstaticvoiddoQuery(Int32userId){using(SqlConnectionconnection=newSqlConnection(connectionString)){SqlCommandcommand=newSqlCommand("SELECT attr FROM table WHERE id="+userID,connection);}}}
usingSystem.Xml;classMyClass{publicstaticvoidgoQuery(Int32userID){Stringquery1="SELECT attr FROM table WHERE id="+userID;}}
Compliant Code Examples
usingSystem.Xml;classMyClass{publicstaticvoiddoQuery(Int32userID){using(SqlConnectionconnection=newSqlConnection(connectionString)){SqlCommandcommand=newSqlCommand("SELECT attr FROM table WHERE id=@ID",connection);command.Parameters.Add("@ID",SqlDbType.Int);command.Parameters["@ID"].Value=userID;}}}
Seamless integrations. Try Datadog Code Security
Datadog Code Security
Try this rule and analyze your code with Datadog Code Security
How to use this rule
1
2
rulesets:- csharp-security # Rules to enforce C# security.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Security scans to your CI pipelines