mr_medhat
Posts: 16
|
Posted: 07/11/2006, 3:30 AM |
|
This ASP code works fine for showing no records in a grid if no search parameters were given :
if (FormName.command.Where = "") then
Form.command.Where = "FieldName = impossible_value"
end if
What is its equivalent code for .NET , VB !!
Thanks in advance
|
|
|
Stan
|
Posted: 07/12/2006, 1:30 AM |
|
You can add in the Query Bilder where parameter with logical operation "Or". And this parameter should always return false. For example 1=2. In such case, when some prameters will be passed, this expression will be ignored. But in case of missing parameters, it will not return records. It is the same trick, which you use for ASP, but without custom code.
|
|
|
mr_medhat
Posts: 16
|
Posted: 07/14/2006, 6:08 AM |
|
Thanks Stan , That sounds smart , I'll try it right away .
|
|
|
WKempees
|
Posted: 07/14/2006, 9:22 AM |
|
Also it should be possible to set the default value of your already existing
Where, in VQB, to a non-existing value.
For instance if the search field is a positive numeric, then in the Where
Parameter Dialogue you can enter -1 as a default value, any value that is
not in the database.
This (normal behaviour) should prevent your empty where being ignored.
Walter
|
|
|
|