Click here to Skip to main content
15,914,162 members
Home / Discussions / Database
   

Database

 
GeneralSchedule a program Pin
yesu prakash25-Apr-08 20:30
yesu prakash25-Apr-08 20:30 
GeneralRe: Schedule a program Pin
Pete O'Hanlon25-Apr-08 23:55
mvePete O'Hanlon25-Apr-08 23:55 
GeneralRe: Schedule a program Pin
GuyThiebaut26-Apr-08 3:41
professionalGuyThiebaut26-Apr-08 3:41 
Generaloledb query Pin
Member 412921825-Apr-08 20:07
Member 412921825-Apr-08 20:07 
GeneralRe: oledb query Pin
Blue_Boy26-Apr-08 3:15
Blue_Boy26-Apr-08 3:15 
GeneralRe: oledb query Pin
ChinaTJBoy1-May-08 3:39
ChinaTJBoy1-May-08 3:39 
GeneralRe: oledb query Pin
Member 30299284-May-08 19:55
Member 30299284-May-08 19:55 
GeneralCreate a custom search string Pin
Paul McGann25-Apr-08 7:42
professionalPaul McGann25-Apr-08 7:42 
Hello,

I'm all new to this programming but i'm gently getting the grasp of things, but sometimes feel i'm stepping ahead of myself. Just a quick question, i'm trying to create a search string based on certain choices that the user makes. The user is able to select all the choices or nothing at all or parts of the choices. My problem is I think I'm goin about it the wrong way below is the string that i have created that creates an sql search string, based upon the users choices.

Dim search_str As String = "SELECT * FROM Properties WHERE"

If ddl_type.SelectedValue <> "0" Then
search_str += "Property_Type =" + ddl_type.SelectedItem.Text
End If

If ddl_location.SelectedValue <> "0" Then
search_str += "AND Property_Location =" + ddl_location.SelectedItem.Text
End If

If ddl_bedrooms.SelectedValue <> "0" Then
search_str += "AND Property_Bedrooms =" + ddl_bedrooms.SelectedItem.Text
End If

If ddl_max_price.SelectedValue <> "0" Then
search_str += "AND Property_Price <=" + ddl_max_price.SelectedItem.Text
End If

If ddl_min_price.SelectedValue <> "0" Then
search_str += "AND Property_Price >=" + ddl_min_price.SelectedItem.Text
End If

For i = 0 To cbl_features.Items.Count - 1
If cbl_features.SelectedItem.Selected = True Then
search_str += "AND Property_Features Like" + cbl_features.SelectedItem.Text
End If
Next

could someone have a look at this and check to see if this is the best method for creating this search, or possibly suggest an alternative.

Regards
Paul Mc Gann
GeneralRe: Create a custom search string Pin
Mark J. Miller25-Apr-08 9:06
Mark J. Miller25-Apr-08 9:06 
GeneralRe: Create a custom search string Pin
Paul McGann25-Apr-08 9:45
professionalPaul McGann25-Apr-08 9:45 
GeneralRe: Create a custom search string Pin
ChandraRam27-Apr-08 23:24
ChandraRam27-Apr-08 23:24 
Questionis it possible to replicate mysql data on mssql server [modified] Pin
Talsaniya Jayesh25-Apr-08 5:27
professionalTalsaniya Jayesh25-Apr-08 5:27 
QuestionApplication roles Pin
aecordoba25-Apr-08 4:15
aecordoba25-Apr-08 4:15 
Generaltotal Impression for same id and name Pin
r aa j24-Apr-08 23:04
r aa j24-Apr-08 23:04 
GeneralRe: total Impression for same id and name Pin
Blue_Boy25-Apr-08 0:05
Blue_Boy25-Apr-08 0:05 
GeneralRe: total Impression for same id and name Pin
andyharman25-Apr-08 0:12
professionalandyharman25-Apr-08 0:12 
GeneralRe: total Impression for same id and name Pin
Rajkamal_dfine25-Apr-08 20:52
Rajkamal_dfine25-Apr-08 20:52 
Generaldatabase problem Pin
snouto24-Apr-08 22:24
snouto24-Apr-08 22:24 
GeneralRe: database problem Pin
Ashfield24-Apr-08 22:27
Ashfield24-Apr-08 22:27 
GeneralRe: database problem Pin
snouto24-Apr-08 22:29
snouto24-Apr-08 22:29 
GeneralRe: database problem Pin
Vasudevan Deepak Kumar24-Apr-08 22:57
Vasudevan Deepak Kumar24-Apr-08 22:57 
GeneralRe: database problem Pin
Blue_Boy24-Apr-08 22:39
Blue_Boy24-Apr-08 22:39 
GeneralRe: database problem Pin
snouto24-Apr-08 22:42
snouto24-Apr-08 22:42 
GeneralRe: database problem Pin
Blue_Boy24-Apr-08 22:45
Blue_Boy24-Apr-08 22:45 
GeneralRe: database problem Pin
snouto24-Apr-08 22:48
snouto24-Apr-08 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.