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)

Recommended Answers

All 2 Replies

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 ?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.