Invoke a specific printer to print C# WPF




I want to call a specific printer to print in my WPF application.I have three printerSupposePrinter1 for Bar bill PrintPrinter2 for Kitchen bill PrintPrinter3 for Guest bill Printprinters name already saved in database, while printing I get a printer name from DBand want to print from specific printer, not defaul printerHere is my code

var v = new PrinterDAL().GetPrinterSettings();try{   System.Threading.Thread thread = new System.Threading.Thread(new       System.Threading.ThreadStart(            delegate()            {                   gridPrint.Dispatcher.Invoke(DispatcherPriority.Normal,                    new Action(                    delegate()                    {                            PrintDialog printDialog = new PrintDialog();                            printDialog.PrintQueue = new PrintQueue(                                new PrintServer(@"\" + v.BarPrinter), "");                            printDialog.PrintVisual(gridPrint, "");                            this.Close();                    }                ));            }            ));            thread.Start();}catch (Exception ex){     Xceed.Wpf.Toolkit.MessageBox.Show(ex.Message, "", MessageBoxButton.OK,                                        MessageBoxImage.Error);}

I get an exception from this code

"An exception occurred while creating the PrintServer object. Win32 error: The printer name is invalid."

PrintServer must be instance using a computer or printer server device in the form of windows net name (\resource) not a printer name:

For example, if the name of your computer, in your domain, is KashifPC and you have configured a printer, called "Printer1", you can use:

//example code. no error handling.PrintServer localPS = New PrintServer(@"\KashifPC")PrinterQueue printer1 = localPS.GetPrintQueue("Printer1") //v.BarPrinter???PrintDialog printDialog = new PrintDialog();printDialog.PrintQueue = printer1//rest of code