Fixed escape characters on in the Printer Name queries so that you can select a printer with an apostrophe in the Name

This commit is contained in:
Gregory Diaz 2015-06-10 14:59:14 -07:00
parent 735386f008
commit e6ce343a1e

View file

@ -201,7 +201,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
if (usingDefaultName)
{
string printerInputName = String.Format("{0} {1}", this.ActivePrinter.Make, this.ActivePrinter.Model);
string query = string.Format("SELECT Name FROM Printer WHERE Name LIKE \'{0}%\';", printerInputName);
string query = string.Format("SELECT Name FROM Printer WHERE Name LIKE \"{0}%\";", printerInputName);
var names = Datastore.Instance.dbSQLite.Query<sqlName>(query).Select(item => item.Name).ToList();
if (!names.Contains(printerInputName))