I am using this code below to generate barcodes using asp.net but when i print them the scanner does not read them.
ReadTimeout = 'ms.ReadTimeout' threw an exception of type 'System.InvalidOperationException'
WriteTimeout = 'ms.WriteTimeout' threw an exception of
please help
Public Function GetDatad200(ByVal query As String) As Customersdataset
Dim conString As String = ConfigurationManager.ConnectionStrings("SLISConnectionString").ConnectionString
Dim cmd As SqlCommand = New SqlCommand(query)
Using con As SqlConnection = New SqlConnection(conString)
Using sda As SqlDataAdapter = New SqlDataAdapter()
cmd.Connection = con
sda.SelectCommand = cmd
Using dsCustomers As Customersdataset = New Customersdataset
sda.Fill(dsCustomers, "DataTable1")
Dim dt As DataTable = dsCustomers.Tables("DataTable1")
For i As Integer = 0 To (dsCustomers.DataTable1).Rows.Count - 1
dsCustomers.DataTable1.Rows(i)("Qrcode") = GenerateBarcode(((dsCustomers.DataTable1).Rows(i)("Barcode").ToString()))
Next
Return dsCustomers
End Using
End Using
End Using
End Function
Private Function GenerateBarcode(ByVal qrmsg As String) As Byte()
Dim barCode As String = qrmsg
Using bitMap As Bitmap = New Bitmap(barCode.Length * 40, 80)
Using graphics As Graphics = graphics.FromImage(bitMap)
Dim oFont As Font = New Font("IDAutomationHC39M Free Version", 16)
Dim point As PointF = New PointF(2.0F, 2.0F)
Dim blackBrush As SolidBrush = New SolidBrush(Color.Black)
Dim whiteBrush As SolidBrush = New SolidBrush(Color.White)
graphics.FillRectangle(whiteBrush, 0, 0, bitMap.Width, bitMap.Height)
graphics.DrawString("*" & barCode & "*", oFont, blackBrush, point)
End Using
Using ms As MemoryStream = New MemoryStream()
ms.Flush()
ms.Position = 0
bitMap.Save(ms, ImageFormat.Png)
Return ms.ToArray()
End Using
End Using
End Function