Monday, April 28, 2014

Retrieving information from database into text box.

Hi, if you know the name of control, you can use ControlCollection.Item Property or ControlCollection.Find method to get it.


http://ift.tt/1mTOPnc


http://ift.tt/1m4ElVc


sample code below:



Do While i <> 30
Me.Controls("statename" & i.ToString()).Text = dataReader(p).ToString()
P = P + 1
i = i + 1
Loop

Or



Do While i <> 30
Me.Controls.Find("statename" & i.ToString(), True)(0).Text = dataReader(p).ToString()
p = p + 1
i = i + 1
Loop


No comments:

Post a Comment