mysql - How do I parameterize how users input their Connection Strings in C#? -



mysql - How do I parameterize how users input their Connection Strings in C#? -

i've learned how parameterize text boxes when we're talking inserting info within database, i'd implement same technique while manually putting connection string sql database. code goes this:

connectionstring = "server=localhost;uid=" + usr.text + ";pwd=" + pwd.text;

and think quite vulnerable sql injections. suggestions?

it's not vulnerable sql injections since sql isn't beingness used in case. can't access tables , records specifying in connection string, nor can receive info specifying connection string.

it is vulnerable connection string property injection, nikola mentions in answer. see question, " ms access - prevent sql injection in connection string ".

c# mysql

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -