Monday, February 8, 2010

Barcode Rendering Framework (CodePlex Open Source Community)

Project Description
The bar-code rendering framework quite simply encapsulates the native rendering of barcode symbologies without requiring third-party fonts. The framework makes it easy to define new symbologies and use the resultant images from web or forms applications in a variety of usage scenarios.

Currently supported bar-code symbologies;
  • Code 11 with or without checksum
  • Code 25 standard/interleaved with or without checksum
  • Code 39 with or without checksum
  • Code 93 with checksum only
  • Code 128 with checksum only
  • Code EAN 13 with checksum only
  • Code EAN 8 with checksum only
  • Code PDF417 2D with checksum (alpha version)

A sample web application is included to demonstrate usage of the rendering classes from a web environment - it's still rather simple though!

Ref: http://barcoderender.codeplex.com/

We can apply Max function in SQL Query for Varchar Coloumn

=============SQL===============================

ALTER PROCEDURE [dbo].[evs_MaxVisaNo]
AS
BEGIN

DECLARE @Length INT
SET @Length=(SELECT MAX(LEN(VisaNo)) from [Application])
SELECT TOP 1 VisaNo FROM [Application] WHERE LEN(VisaNo)=@Length ORDER BY VisaNo DESC

END

===============ASP.NET===============
//Begin Exec Procedure
SqlCommand cmdVisaNo = new SqlCommand();
SqlDataReader rdVisaNo;
cmdVisaNo.CommandText = "evs_MaxVisaNo";
cmdVisaNo.CommandType = CommandType.StoredProcedure;
cmdVisaNo.Connection = con;
rdVisaNo = cmdVisaNo.ExecuteReader();
//End Exec Procedure

---------------------------------------------------------
DECLARE @Length INT
SET @Length=(SELECT MAX(LEN(VisaNo)) from [Application])
SELECT TOP 1 VisaNo FROM [Application] WHERE LEN(VisaNo)=@Length ORDER BY VisaNo DESC