Click here to Skip to main content
15,904,500 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: suggest me a control Pin
Dave Kreskowiak24-Aug-07 5:40
mveDave Kreskowiak24-Aug-07 5:40 
GeneralRe: suggest me a control Pin
eyes200724-Aug-07 5:48
eyes200724-Aug-07 5:48 
GeneralRe: suggest me a control Pin
Dave Kreskowiak24-Aug-07 5:56
mveDave Kreskowiak24-Aug-07 5:56 
GeneralRe: suggest me a control Pin
eyes200724-Aug-07 5:43
eyes200724-Aug-07 5:43 
QuestionWhat is Wrong in my Datagrid Search Style Pin
Vimalsoft(Pty) Ltd23-Aug-07 21:44
professionalVimalsoft(Pty) Ltd23-Aug-07 21:44 
AnswerRe: What is Wrong in my Datagrid Search Style Pin
Dave Kreskowiak24-Aug-07 5:54
mveDave Kreskowiak24-Aug-07 5:54 
GeneralRe: What is Wrong in my Datagrid Search Style Pin
Vimalsoft(Pty) Ltd26-Aug-07 20:06
professionalVimalsoft(Pty) Ltd26-Aug-07 20:06 
GeneralRe: What is Wrong in my Datagrid Search Style Pin
Dave Kreskowiak27-Aug-07 12:09
mveDave Kreskowiak27-Aug-07 12:09 
Vuyiswamb wrote:
how am i going to return the user's required results if i dont use where in my SQl statement?


You said you want the statement to ignore certain parts of the WHERE clause. Since you can't do that, you have to REMOVE THOSE PARTS FROM THR WHERE CLAUSE.

By removing certain conditions from the WHERE clause, this:
SELECT someColumn1, someColumn2, someColumn3 FROM table WHERE condition1 AND condition2 AND condition3

becomes:
SELECT someColumn1, someColumn2, someColumn3 FROM table WHERE condition1 AND condition3



Vuyiswamb wrote:
How dynamically, i dont understand.please post an example code or point to an article.


Check each part of the UI for a value entered by the user. If each condition, add it to the end of the SQL statement. Greatly simplified, it looks like:
Dim mySQLstring As String = "SELECT someColumn1, someColumn2, someColumn3 FROM table WHERE"
If someCondition Then
    mySQLstring = mySQLstring & " condition1 "
End If

If someCondition Then
    mySQLstring = mySQLstring & " AND condition2 "

This logic will NOT work!! If makes certain assumptions about the presence of the "WHERE" in teh SQL statement and doesn't check to see if an "AND" is required between conditions!!


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: What is Wrong in my Datagrid Search Style Pin
Vimalsoft(Pty) Ltd27-Aug-07 21:29
professionalVimalsoft(Pty) Ltd27-Aug-07 21:29 
QuestionCode structure Pin
digicd123-Aug-07 16:28
digicd123-Aug-07 16:28 
QuestionIs it Memory Problem????? Pin
dimuthuvbnet23-Aug-07 15:52
dimuthuvbnet23-Aug-07 15:52 
AnswerRe: Is it Memory Problem????? Pin
Luc Pattyn23-Aug-07 16:23
sitebuilderLuc Pattyn23-Aug-07 16:23 
AnswerRe: Is it Memory Problem????? Pin
Vimalsoft(Pty) Ltd23-Aug-07 19:56
professionalVimalsoft(Pty) Ltd23-Aug-07 19:56 
AnswerRe: Is it Memory Problem????? Pin
petersgyoung24-Aug-07 15:21
petersgyoung24-Aug-07 15:21 
Questionfastest way to select all checkboxes in DataGridView Pin
Far sh23-Aug-07 15:51
Far sh23-Aug-07 15:51 
AnswerRe: fastest way to select all checkboxes in DataGridView Pin
Dave Kreskowiak24-Aug-07 5:49
mveDave Kreskowiak24-Aug-07 5:49 
AnswerRe: fastest way to select all checkboxes in DataGridView Pin
Pascal Ganaye24-Aug-07 6:01
Pascal Ganaye24-Aug-07 6:01 
QuestionGmail problem in webbrowser control and its licence Pin
Ahmad Zaidi23-Aug-07 9:43
Ahmad Zaidi23-Aug-07 9:43 
AnswerRe: Gmail problem in webbrowser control and its licence Pin
Christian Graus23-Aug-07 11:32
protectorChristian Graus23-Aug-07 11:32 
QuestionVB6 Printing Problem Pin
slk100023-Aug-07 9:40
slk100023-Aug-07 9:40 
AnswerRe: VB6 Printing Problem Pin
Dave Kreskowiak24-Aug-07 5:46
mveDave Kreskowiak24-Aug-07 5:46 
QuestionTreeview Selected Node Pin
ejaz_pk23-Aug-07 5:58
ejaz_pk23-Aug-07 5:58 
AnswerRe: Treeview Selected Node Pin
Dave Kreskowiak24-Aug-07 6:03
mveDave Kreskowiak24-Aug-07 6:03 
GeneralRe: Treeview Selected Node Pin
ejaz_pk25-Aug-07 10:51
ejaz_pk25-Aug-07 10:51 
GeneralRe: Treeview Selected Node Pin
Dave Kreskowiak26-Aug-07 4:21
mveDave Kreskowiak26-Aug-07 4:21 

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.