Commits

Kit Roed committed 301d8e6

I would like to thank OleDbParameters for protecting me from funky filenames...

  • Participants
  • Parent commits 2035772

Comments (0)

Files changed (1)

FoxProReader/Reader.cs

             dt.Clear();
             dt.Columns.Clear();
 
-            // the following injected code could still fail if we are trying to parse a file with ']' in the name
-            OleDbDataAdapter da = new OleDbDataAdapter("select * from [" + vfpFileName + "]", conn);
+            string queryString = "select * from ?";
+            OleDbCommand command = new OleDbCommand(queryString, conn);
+            command.Parameters.Add("@p1", OleDbType.VarChar).Value = vfpFileName;
+            OleDbDataAdapter da = new OleDbDataAdapter(command);
+            
 
             try
             {