Click here to Skip to main content
15,888,175 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
hey friend. i have some project. i need get address to
lable when i enter name into textbox.my code is like this
ds.clear
da=new sqldataadapter("SELECT * FROM members
WHERE name=" & textbox1.text &"", dbconn)
try
da.fill(ds,members)
bind()
catch ex as exception
exit sub
end try
sub bind()
lable1.databindings.add("text",ds,"members.memname")
end sub

unfortunatly its not work and i got this erro message
"invalied column name"
then i try search infomation by there age. its worked. but
i have no idea to get address when enter there names.
im using vb.net and sql server.
please help me . please
Posted
Updated 3-Feb-12 6:59am
v3
Comments
Sridhar Patnayak 3-Feb-12 12:30pm    
Repeated question , your answer at link http://www.codeproject.com/Questions/324507/bind-table-data-in-vb
Sridhar Patnayak 3-Feb-12 12:43pm    
update your existing link

1 solution

You should never do this. I'd fire anyone who wrote code like this, or asked this sort of question.

Your code makes it trivial for me to delete your database. You should never build SQL from concatenating strings.

Your variables have names like textbox1 which make it easy to get confused and are not self documenting.

Your error means what it says, you're trying to read a column that is not there.

You need to not ask the same question over and over. You need to abandon your current project, buy a beginners book and work through it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900