Click here to Skip to main content
15,899,562 members

Comments by Max Vagner (Top 3 by date)

Max Vagner 31-Oct-12 4:34am View    
What are you using to read XML? Is file located locally? Try System.Xml.Linq.XElement.Load()
Max Vagner 25-Oct-12 7:19am View    
You don't have to sacrifice convenience. It's possible to use SQL select statement with parameters which will prevent possibility of injection. Here's example:
SqlCommand cmd = new SqlCommand("SELECT * FROM Customers WHERE city = @City", conn);
SqlParameter param = new SqlParameter();
param.ParameterName = "@City";
param.Value = inputCity;
Max Vagner 22-Oct-12 17:10pm View    
Off-topic: Your code is vulnerable to SQL injection. For example, If I enter "'' where 1=1--" in your textBox1, it will corrupt every single record in your database. You should avoid building SQL string. Use stored procedure instead.