Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
How to print label using zpl QLn220 printer, it's connected to my PC via Bluetooth. I want print function from c#.Net

additional information after comment below
Thanks. I tried and Finally posted question here. Actually my printer is connected via Bluetooth to COM3 standard serial port of my PC. I am trying to open that port using following code
C#
SerialPort sp = new SerialPort();
sp.PortName = "COM4";
sp.BaudRate = 9600;
sp.Parity = Parity.None;
sp.DataBits = 8;
sp.StopBits = StopBits.One;
sp.Handshake = Handshake.RequestToSend;
sp.Open();

while opening the port I am getting following error
"The given port name does not start with COM/com or does not resolve to a valid serial port.Parameter name: portName"

Some people suggested me to change port number I changed from COM3 to COM4 still getting same eeror.
Posted
Updated 6-Oct-14 22:20pm
v2
Comments
[no name] 7-Oct-14 4:56am    
Do you have a printer driver installed for this device? If so you may have to uninstall it.

Reading the error it seems the name you are giving is not matching the correct format or maybe not existant in your system.
Have a look to these links, they might help.
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport(v=vs.100).aspx[^]
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.getportnames(v=vs.100).aspx[^]
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.portname(v=vs.100).aspx[^]
 
Share this answer
 
v4
Comments
Member 10117590 7-Oct-14 4:16am    
Thanks. I tried and Finally posted question here. Actually my printer is connected via Bluetooth to COM3 standard serial port of my PC. I am trying to open that port using following code

SerialPort sp = new SerialPort();
sp.PortName = "COM4";
sp.BaudRate = 9600;
sp.Parity = Parity.None;
sp.DataBits = 8;
sp.StopBits = StopBits.One;
sp.Handshake = Handshake.RequestToSend;
sp.Open();


while opening the port I am getting following error
"The given port name does not start with COM/com or does not resolve to a valid serial port.Parameter name: portName"

Some people suggested me to change port number I changed from COM3 to COM4 still getting same eeror.
Nelek 7-Oct-14 4:27am    
Answer edited, have a look. The links might help
[no name] 7-Oct-14 4:35am    
As has been said you need to develop systematic problem solving skills. At the moment you are poking at shadows.
Run this example (already mentioned) then work out how to proceed: http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.getportnames(v=vs.110).aspx
Nelek 7-Oct-14 5:49am    
You clicked the wrong button ;P
The Zpl printer was connected to Standard Serial port via Bluetooth. I solved it by following this link Printing label and Barcodes using ZPL printer from C#.Net
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900