locked
barcode scanning..... RRS feed

  • Question

  • User1381052791 posted

    i just want to scan a barcode directly from barcode reader & transfer that data in to the database........

    is there any events ir method to get the code & integrate it in the application?

    Monday, January 2, 2012 3:49 AM

Answers

  • User3866881 posted

    Hello

    ali.unlimite...

    :)

    For about Bar Code's scanner,it doesn't have something to do with ASP.NET purely directly,I mean that you should connect to the 3-rd party for the API。

    For scanning out(let's suppose you have the method called "ScannerBarCode",and it returns a string of barcode……)You can use this to insert into bar

    using(SqlCommand cmd = new SqlCommand("Insert into xxx values(@barcode)",new SqlConnection("……"))
    {
        cmd.Parameters.AddWithValue("@barcode",Your Bar Code);
        cmd.ExecuteNonQuery();
    } 
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 3, 2012 8:24 PM

All replies

  • User522486851 posted

    Hey before all we want to what kind of barcode scanner you going to use?

    Is it connected to your keyboard, serial port or usb port?

    keyboard connected barcode scanner output its scanned directly into the any text control in your project even to your notepad.

    For other scanners you have to setup a thread that read respective port time to time.

    this is according to my knowledge but there may be other type of barcode scanner .

    you can find so may articales about port readings...

    Monday, January 2, 2012 4:31 AM
  • User1381052791 posted

    i am advised to use serial barcode scanner but the problem is how can i bind it to the database like when i scan the given barcode the database is searched for the given key & return the found row for that key so how can i achive this?

    Monday, January 2, 2012 5:14 AM
  • User522486851 posted

    When you got a scanned barcode its serial of alphanumeric charcters so you can do  anything with dat.

    As an exsample. If you have product database that each product have unique product code. you can print that product code as barcode and use.

    then when you scan the barcode it'll always give you a product code.

    you have to send it to the database only.

    or other apporch you can do is you can store a barcode which your product contain in your database in a different column.

    Monday, January 2, 2012 5:29 AM
  • User1381052791 posted

    ok but the products purchased in bunches thus is there any way to get all the barcode numbers with appropriate details autometically in the database

    i have heared of exelsheets provided with the product bunches is there any way to integrate this excelsheet directly into database?

    Tuesday, January 3, 2012 5:07 AM
  • User3866881 posted

    Hello

    ali.unlimite...

    :)

    For about Bar Code's scanner,it doesn't have something to do with ASP.NET purely directly,I mean that you should connect to the 3-rd party for the API。

    For scanning out(let's suppose you have the method called "ScannerBarCode",and it returns a string of barcode……)You can use this to insert into bar

    using(SqlCommand cmd = new SqlCommand("Insert into xxx values(@barcode)",new SqlConnection("……"))
    {
        cmd.Parameters.AddWithValue("@barcode",Your Bar Code);
        cmd.ExecuteNonQuery();
    } 
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 3, 2012 8:24 PM
  • User522486851 posted

    If the Excel sheet is available you can import it in to your database, and update your product table with a imported barcode.

    Tuesday, January 3, 2012 11:11 PM
  • User1381052791 posted

    please can you give me some clearer example please.

    Wednesday, January 4, 2012 11:50 PM
  • User3866881 posted

    please can you give me some clearer example please.

    Hello:)

    I've given you a snippet of ideas in the form of simple sample,I think it's clear。Attention is that you should connect to 3-rd party of the API of reading the barcode…… I've sent you codes about inserting into db with bar codes……

    Welcome your feedback。

    Thursday, January 5, 2012 3:51 AM
  • User1381052791 posted

    ok thanks

    Thursday, January 5, 2012 3:58 AM
  • User3866881 posted

    ok thanks

    Haha……No problem at all…… You can freely feedback and welcome to the forum to help others or chat with us about what you want……

    Thursday, January 5, 2012 4:00 AM