mysql - selecting one item with two conditions and retrieving in vb.net -
i want retrieve 2 items selected , put in label. here's code.
lcommand .connection = connection .commandtext = "select pass officememberprofile usern = 'csprofile1' or usern = 'csprofile2'" lreader = .executereader end lreader while .read label4.text = .item(0) label5.text = .item(1) end while end -expected result: label4.text should contain cspass1 , label5.text should contain cspass2, the end result wrong. retrieving first item. can show me how use while loop , retrieve 2 items in respective labels. thank you
each time while runs, gets row of result. result has 1 column. can store in stack , extract them labels
with lcommand .connection = connection .commandtext = "select pass officememberprofile usern = 'csprofile1' or usern = 'csprofile2'" lreader = .executereader end dim x new stack(of string) lreader while .read x.push(.item(0)) end while end label4.text = x.pop() label5.text = x.pop()
Comments
Post a Comment