Barcode Professional for ASP. NET USE Tutorial: Barcode image saved to database or XML file

Source: Internet
Author: User

Barcode Professional has a special method for obtaining barcode images, which can be used to represent the generation of barcode images using array bytes, so we can call this method to save the barcode image to a database or an XML file.

In the following example, we will create an ASP. NET Web application that can save the barcode image to an XML file through a DataSet object.

Steps:

    • Open it. NET development tools, such as visual Studio. NET, and create a new ASP.

    • Drag down the column control to the design interface:

      • Barcode Professional Controls

      • TextBox control

      • Button control

      • Panel control and added to the literal control

    • Set Barcode Professional ' s symbology property 128 yards

    • Set Panel ' s Visible property to False

    • Double-click the button control and write the following code to the Button1_Click event program

VB
' Set the value to Encodebarcodeprofessional1.code = TextBox1.Text ' Create a DataSet and save the barcode Imagedim DS as Dat ASet = new DataSet ("myDataSet") Dim dt as DataTable = new DataTable ("MyTable") ds. Tables.add (DT) ' Create a ' column to hold the barcode Imagedim dc as DataColumn = New DataColumn ("Barcodeimage", GetType (Byte ())) dt. Columns.Add (DC) ' Create a new Rowdim dr as DataRow = dt. NewRow () ' Save the barcode imagedr ("barcodeimage") = Barcodeprofessional1.getbarcodeimage ( System.Drawing.Imaging.ImageFormat.Gif) dt. Rows.Add (DR) ' Show the DataSet contentliteral1.text = Server.HTMLEncode (ds. GETXML ()) panel1.visible = True
C #
Set the value to Encodebarcodeprofessional1.code = Textbox1.text;//create a DataSet and save the barcode Imagedataset DS = new DataSet ("myDataSet");D atatable dt = new DataTable ("MyTable");d S. Tables.add (DT);//create a column to hold the barcode imagedatacolumn DC = new DataColumn ("Barcodeimage", typeof (Byte[]));d T.columns.add (DC);//create a new Rowdatarow dr = dt. NewRow ();//save the barcode imagedr["barcodeimage"] = Barcodeprofessional1.getbarcodeimage ( System.Drawing.Imaging.ImageFormat.Gif);d T. Rows.Add (DR);//show the DataSet contentliteral1.text = Server.HTMLEncode (ds. GETXML ()); Panel1.visible = true;

Run the created ASP. NET Web application, and you'll see the output

650) this.width=650; "alt=" Barcode "class=" Img-thumbnail "src=" http://image.evget.com/images/article/2015/ Result1small.jpg "/>

650) this.width=650; "alt=" Barcode "class=" Img-thumbnail "src=" http://image.evget.com/images/article/2015/ Result2small.jpg "/>


This article is from the "294936239" blog, please be sure to keep this source http://294936239.blog.51cto.com/10806039/1709584

Barcode Professional for ASP. NET USE Tutorial: Barcode image saved to database or XML file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.