Hello
See this code in a C# program: how can i use the value 'John' in this sql-statement? I tried this but gives nothing
sql="select name from clients where clients=' " + "John' ";
Thanks
V
Hello
See this code in a C# program: how can i use the value 'John' in this sql-statement? I tried this but gives nothing
sql="select name from clients where clients=' " + "John' ";
Thanks
V
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Jul 6, 2021, 9:53 AM EDT
If you have a little knowledge of SQL-Injection attacks then you must be knowing that your code is not only wrong but also vulnerable to the attack, never build the query by concatenating user inputs, a malicious user may enter a SQL query instead of a username.
Always use a parameterized query or Stored procedures when working with ADO.Net
Note:- cs is connection string and rdr[n] means nth column in DB.
Valerie MeunierRank #1,527 · 1K reputationPosted Jul 8, 2021, 7:14 AM EDT