prabhu_venkatraman
New member
- Joined
- Apr 28, 2014
- Messages
- 3
- Programming Experience
- 3-5
Hi!
I am trying to retrive information data from Access database into textbox in vb.net. I am able to get the count but not able to display it in the form.
For example: total state in india is 29. so need to display all the names. I have textbox in the form as statename1.text, statename2.text, statename3.text till statename29.text. So I want to display in loop.
vb.net code.
dim i, p as integer
command = New OleDbCommand("Select state from country where country="India""", connection)
dataReader = command.ExecuteReader
dataReader.Read()
i = 1
P = 0
Do While i <> 30
statename & i &.text = dataReader(P).ToString()
P = P + 1
i = i + 1
Loop
I am trying something like this but i know, its not right. Please advice. I am getting error on "statename & i &.text"
Regards,
Prabhu Venkatraman
I am trying to retrive information data from Access database into textbox in vb.net. I am able to get the count but not able to display it in the form.
For example: total state in india is 29. so need to display all the names. I have textbox in the form as statename1.text, statename2.text, statename3.text till statename29.text. So I want to display in loop.
vb.net code.
dim i, p as integer
command = New OleDbCommand("Select state from country where country="India""", connection)
dataReader = command.ExecuteReader
dataReader.Read()
i = 1
P = 0
Do While i <> 30
statename & i &.text = dataReader(P).ToString()
P = P + 1
i = i + 1
Loop
I am trying something like this but i know, its not right. Please advice. I am getting error on "statename & i &.text"
Regards,
Prabhu Venkatraman
Last edited: