michael03m
New member
- Joined
- Dec 3, 2010
- Messages
- 1
- Programming Experience
- Beginner
Hi,
I'm pretty much a beginner with VB.NET and am in the middle of a project for my class. I created an array of strings that pulls data from a csv file, and now im trying to update a database file with it. It gives me an error, though, saying it can't convert my string array into an integer. Can anyone help me?
I'm pretty much a beginner with VB.NET and am in the middle of a project for my class. I created an array of strings that pulls data from a csv file, and now im trying to update a database file with it. It gives me an error, though, saying it can't convert my string array into an integer. Can anyone help me?
VB.NET:
Dim UPCquantity As Integer
Dim updatedUPCquan As Integer
Dim UPC As Integer
Dim UPCquan As Integer
Dim upcstring(0) As String
Dim inputstream As New FileStream("packingslip.csv", FileMode.Open, FileAccess.Read)
Dim reader As New StreamReader(inputstream)
Do Until reader.EndOfStream
upcstring = reader.ReadLine.Split(",")
UPC = upcstring(0)
UPCquan = upcstring(1)
UPCquantity = myInvDB.GetQtyOnHand(1, UPC)
updatedUPCquan = UPCquan + UPCquantity
myInvDB.UpdateQtyOnHand(1, UPC, updatedUPCquan)
Loop
If myInvDB.UpdateQtyOnHand(1, manualUPC.Text, updatedUPCquan) = True Then
MsgBox("Successful Entry")
Else
MsgBox("Unsuccessful")[/SIZE][/SIZE]
End If
End Sub
Last edited by a moderator: