Jeremy Tourville
Member
- Joined
- May 22, 2015
- Messages
- 5
- Programming Experience
- Beginner
I have a text box that I can input multiple lines of numbers in. I want to compare each line of numbers against my dataset to find a match. If it matches it should update my database.
My pseudo code should be something like this-
Get input from textbox
Index number of inputs from text box
Get input from dataset
Index number of inputs from data set
Compare text box input to all inputs from dataset
Continue to compare all inputs from text box to all inputs from dataset until the text box max index/upper bound is reached.
My actual code is a mess and I know it needs to be fixed but....
I am not a professional developer, just a sysadmin. This is my fist time working with a variable length/multiline text box. Can someone suggest some techniques so I can keep track of the index of the text box input? I think if I can get that part worked out I can fix my logic on the looping through the database to compare.
My pseudo code should be something like this-
Get input from textbox
Index number of inputs from text box
Get input from dataset
Index number of inputs from data set
Compare text box input to all inputs from dataset
Continue to compare all inputs from text box to all inputs from dataset until the text box max index/upper bound is reached.
My actual code is a mess and I know it needs to be fixed but....
For i As Integer = 0 To ds.Tables(0).Rows.Count - 1 Dim dsstring As String = Integer.Parse(ds.Tables(0).Rows(i)(0).ToString()) For Each strline As String In TxtTicketIn.Text.Split(vbNewLine) If StrComp(strline, dsstring) = True Then da.Fill(ds, "MAIN") ds.Tables("MAIN").Rows(n).Item("TBP") = "True" da.Update(ds, "MAIN") da.UpdateCommand = cb.GetUpdateCommand() End If Next Next i
I am not a professional developer, just a sysadmin. This is my fist time working with a variable length/multiline text box. Can someone suggest some techniques so I can keep track of the index of the text box input? I think if I can get that part worked out I can fix my logic on the looping through the database to compare.
Last edited by a moderator: