0

hi
i can not bind text box at runtime successfully in vb.net2003
the code is describe below
imports system.data.sqlclient
dim conn as new sqlconnection
dim cmd as new sqlcommand
dim adp as new sqldataadapter
dim ds as new dataset
// form load
conn.connectionstring=""
cmd.commandtype=commandtype.text
cmd.commandtext="select * from master_dept"
cmd.connection =conn
conn.open
adp.selectcommand=cmd
adp.fill(ds)
textbox1.databinding.add("text",me.ds,"master_dept.dept_name)

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by vuyiswamb
0
textbox1.databinding[B]s[/B].add("text",me.ds,"master_dept.dept_name[B]"[/B])
conn.connectionstring=""

here you should write the connectionstring

what the error you got ?

0

hi All

i think the code should look like this

textbox1.databinding[B]s[/B].add("text",me.ds,"master_dept","dept_name[B]"[/B])

hope it helps

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.