Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
OfMartin
Starting Member
11 Posts |
Posted - 2005-04-16 : 11:37:04
|
Dim strBarcode 'Barcode entered by userIf strBarcode = (this is what i need) Then(this also)Else 'Barcode is invalid Beep() 'Warn user lblHelp.Text = "Please enter a valid barcode"End IfHi everyone ,This is my code to validate barcode entered by the user to see if it matches barcode existing from my database. I need a value or name on the other side of my If statement to represent "barcode that exists in my database". After my Then statment, I need my clause to tell my form to allow the barcode. I just don't know the code for this, so i'd figure I'd ask someone more competent and proficient at this. Thanks in advance,OfMartin890@yahoo.com |
|
jhermiz
3564 Posts |
Posted - 2005-04-18 : 13:19:59
|
You'll need to pick up a book on SQL. Your = (this is what I need)... I assume is just some sort of status which tells you whether a bar code exists or not. You really can do a check and an insert in one transaction. That is:1) Check if the bar code exists...2) If it doesnt add it else dont add itHere is a sample sproc:CREATE PROCEDURE insert_barcode @barcode varchar(50),ASBEGINSET NOCOUNT ONIF EXISTS(SELECT * FROM MyBarCodes WHERE barcode=@barcode ) return -1 --i'm returning -1 back to the client application..already existsELSE--if im here then the barcode does not exist and should be inserted...INSERT INTO MyBarCodes (barcode) Values (@barcode)RETURN SCOPE_IDENTITY() --you could return the identity if you need itSet NOCOUNT OFFEndGO Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]Imperfection living for perfection -- [url]http://jhermiz.blogspot.com/[/url] |
|
|
qrcodenet
Starting Member
4 Posts |
Posted - 2013-01-17 : 22:10:04
|
What kind of barcode you generated? You may input some data that is not included in the barcode standard. You may read tutorial again. I got one tutorial, you may have a look:http://www.tarcode.com/barcode-aspnet/generate-guide.htmlbar code generation DLL |
|
|
|
|
|