Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi people,

I Create a page to people type the fields and then press a button to get a list of what they selected. im having some issues.
the idea is to allow the user to make a search and delete the search lable if they want.
but i need to use the values recorded in the label to create me a sql string

example: sqlq = "SELECT * FROM " & Me.DropDownList1.SelectedValue & " WHERE " & Me.DropDownList2.SelectedValue & Me.DropDownList3.SelectedValue & Me.TextBox1.Text

1- im using labels to do this (not sure if best option) the user completes the field and the values are shown in the label so the users can see them and delete them if they dont want them.

2- i want when the user presses the "button" it saves their first values, and create new lables for a new search and so on ...

i know its kinda confusing to understand but it really need help

http://i.imagebanana.com/img/2azll7bu/Capturar.PNG[^]
Posted
Comments
_Vitor Garcia_ 19-Jun-13 5:37am    
Hi dp24,

Are you aware that your resulting sqlq is something like :
SELECT * FROM Sócios WHERE Número Sócio Maior 1

This comply with standard sql. Do you have a table whose name is Sócios ?
If you have this table then, if there is a Número Sócio column then you should [Número Sócio]. Maior is not recognized by sql. Use > instead.

I think you should understand first your sql query string...
dp24 19-Jun-13 5:59am    
hi, mate forget the string its not my main problem, i said sql but thats just a example i want the lablel to save values and the other things i menssioned.
dp24 19-Jun-13 6:00am    
and we can speake portuguese if you want, i am portguese and i could explain better what i want in portuguese
StianSandberg 19-Jun-13 6:11am    
Watch out for sql-injections!
dp24 19-Jun-13 6:28am    
guys, forget the sql! its not important

1 solution

I think that you should explain more details about the Dropdownlist1, Dropdownlist2, Dropdownlist2, TextBox1 and what for... It is easy for eveyone can answer your question.
 
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