| 
                                                                        
                                                                         
                                                                            
                                                                                joserraff-hotmail
                                                                            - 
                                                                                10/8/2012 10:51:03 AM
                                                                            
                                                                         
                                                                         
                                                                            
                                                                        
                                                                        
                                                                         
                                                                        
                                                                        
                                                                        
                                                                        
                                                                        
                                                                         
                                                                        
                                                                            SQL Injection - TreeHelper.SelectNodes method
                                                                        
                                                                            Hi There,
  I am facing a SQL Injection issue,
  I have the following where clause in the selectNodes method:
  drpVar.SelectedValue = var; DataSet ds = TreeHelper.SelectNodes("/Global/Var/%", true, "custom.Var", "(DocumentName = '" + var + "')", "NodeOrder", 1, true);
  If someone pass the single quote character ' into the var string, the TreeHelper.SelectNodes method raises an exception that exposes the sql query. 
  What would be the best method to avoid that? Could you please provide a quick guide?
  Thank you very much and best regards, Joss
                                                                         
                                                                        
                                                                            
                                                                         
                                                                        
                                                                         
                                                                        
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                         
                                                                        
                                                                            
                                                                            
                                                                            
                                                                            
                                                                         
                                                                        
                                                                         
                                                                     |