title: How to send EPL2 command to a Zebra LP2844 printer via USB using C#
body: <p>I am required to print labels and bar codes on zebra label printer using C#. I have never used them before but read and tried to figure out a way to do that. And I have come across this code from <a href="http://support.microsoft.com/kb/322091" rel="nofollow noreferrer">http://support.microsoft.com/kb/322091</a>, but it didn't work. From my trials I can see that I was able to send the data to the printer but it doesn't respond and print. I am using buttons to send the command to the printer just like in the kb article.</p>
  
  <pre><code>private void  ConnectButton_Click(object sender, EventArgs e)
  {
      // Allow the user to select a printer.
      string s =  "B26,26,0,UA0,2,2,152,B,\"{0}\"";
      PrintDialog pd =  new PrintDialog();
      pd.PrinterSettings = new PrinterSettings();
      if (DialogResult.OK == pd.ShowDialog(this))
      {
         // Send a printer-specific to the printer.
         RawPrintrHelper.SendStringToPrinter(pd.PrinterSettings.PrinterName,s);
         MessageBox.Show("Data sent to printer.");
      }
  }
  </code></pre>