G
Guest
Hi everyone,
I've just started using vb.net (vs.net 2005) after programming in VB6. I've
noticed that control arrays are no longer used and need a little help. In VB6
I would have done this to loop through my recordset and set some values for
text boxes on my form:
Dim i as integer
i = 0
for i = 0 to rstMyRecordSet.Recordcount -1
txtMyTextBox(i).text = rstMyRecordSet.Fields(i).Value
Next i
Obviously I can't do that anymore so can anyone help?
I have a form with 30 text boxes. Each textbox is called txtMyTextbox1,
txtMyTextbox2, txtMyTextbox3 etc etc to 30.
I have a datareader with my data in it and I would like to put the values in
it into my text boxes without having to write out txtMyTextbox1.text = etc
for all 30. Or maybe a better way I can bind my text boxes to my datareader?
Can anyone suggest a way to do it in code?
Any help, greatly appreciated.
Many thanks
Paul
I've just started using vb.net (vs.net 2005) after programming in VB6. I've
noticed that control arrays are no longer used and need a little help. In VB6
I would have done this to loop through my recordset and set some values for
text boxes on my form:
Dim i as integer
i = 0
for i = 0 to rstMyRecordSet.Recordcount -1
txtMyTextBox(i).text = rstMyRecordSet.Fields(i).Value
Next i
Obviously I can't do that anymore so can anyone help?
I have a form with 30 text boxes. Each textbox is called txtMyTextbox1,
txtMyTextbox2, txtMyTextbox3 etc etc to 30.
I have a datareader with my data in it and I would like to put the values in
it into my text boxes without having to write out txtMyTextbox1.text = etc
for all 30. Or maybe a better way I can bind my text boxes to my datareader?
Can anyone suggest a way to do it in code?
Any help, greatly appreciated.
Many thanks
Paul