Generate your serial numbers through the DeployLX Manager.
- Select the target license from the License Editions.
- Select Generate Code | Generate Serial Number.
- Set Number of serials to generate to the desired number.
- Select Plain output.
- Select Generate. The serial numbers are generated and shown.
- Select Save and select a location to save the serial numbers to.
Importing Into SQL Server
There are two ways to import the serials into SQL server. If you have a well structured database and use some sort of ORM tool, you'll want to create a script that parses the Serials.txt file and inserts new objects into the database.
Importing into database with an ORM script
Using serials = New StreamReader("Path to Serials.txt") Do While Not serials.EndOfStream Dim serial = serials.ReadLine() If serial Is Nothing OrElse serial.Length = 0 Then Continue Do End If Dim serialEntity = New SerialNumberEntity() With {.SerialNumber = serial} serialEntity.Save() Loop End Using
using( var serials = new StreamReader( "Path to Serials.txt" ) ) { while( ! serials.EndOfStream ) { var serial = serials.ReadLine(); if( serial == null || serial.Length == 0 ) continue; var serialEntity = new SerialNumberEntity() { SerialNumber = serial }; serialEntity.Save(); } }
Importing with SQL Server Import and Export Wizard
The other option is to import directly into SQL Server using the Import and Export Wizard. This sample will demonstrate importing into a table defined as
CREATE TABLE AvailableSerialNumbers ( ID int IDENTITY(1,1) NOT NULL PRIMARY, Value nvarchar(100) NOT NULL, IssuedToID int NULL, )
- Open SQL Server Management Studio.
- Select View | Object Explorer.
- Right-click on the target database and select Tasks | Import Data.
- Configure the Data Source.
- For Data source select Flat File Source.
- Select Browse... and select the location of the Serials.txt file generated earlier.
- Select Next
- The Destination should be set correctly. Update as needed, then select Next.
- Change the Destination to AvailableSerialNumbers.
- Select Edit Mappings.
- Change the Destination to Value.
- Select OK.
- Select Next, Next, Finish to run the import.
Congratulations. The serial numbers have been imported.