954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

input string was not in the correct format

[code]
[code language = vb.net]
Dim generate As String
Dim added As Integer
Dim addends As Integer
Dim sum As Integer
Dim zero As String
zero = "000"
plus.Text = "1"
added = Int32.Parse(idrecever.Text)
addends = Int32.Parse(plus.Text)
sum = added + addends
generate = "00000"

SqlText = "INSERT INTO Tbl_Items(ItemID, item_name, color, manufacturer, barcode, vendor, item_category, non_stockable, weight, vendors_price, selling_price, image) " _
& "VALUES('ITM'+CONVERT(varchar(99),RIGHT(Year(GETDATE()),2)+'" & generate & "'+'" & Int32.Parse(sum) & "'+day(GETDATE())*1000,12),'" & TextItemDesc.Text & "'," _
& "'" & ComboColor.Text & "', '" & ComboManufacturer.Text & "', '" & TextBarcode.Text & "', " _
& "'" & ComboVndr.Text & "','" & ComboCategory.Text & "', " _
& "'" & DateExpiry.Text & "','" & TextWeight.Text & "', " _
& "'" & TextVdrPrce.Text & "','" & TextSlePrce.Text & "', '&arrImage&')"

comm.CommandText = SqlText[code]

Please help me with this..this code was working with my classmates program but when i try it on my own,it returns the exception input string was not in the correct format.. i don't see any difference between our codes that's why i'm so confused why it is not working for me.. anyway, my goal was to create a unique item id for my table items such that ITM00001 or the like.. if there's anymore way to do this can you please post it here..thanks a lot..

winteranghel
Newbie Poster
1 post since Mar 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You