vb.net - Combobox combinatorics -


i have form 3 combo boxes. value of combo boxes generates sql query 3 parameters. sql generates rdlc report.

for example:

combox1 values(v1,v2,v3,all)

combox2 values(v1,v2,all)

combox3 values(v1,v2,v3,4,all)

me.exampletableadapter.querywithparams(me.exampledataset.table, combobox1.selectedindex, combobox2.selectedindex,combobox1.selectedindex) 

querywithparams:

select * table column1=@c1 , column2=@c2 , column3=@c3 

ok, problem when selected value in combo x, cannot values because must change query , kick out parameter. example: if combo1, combo2, combo3 have values all. don't need parameters.

select * table  

if combo1 all.

select * table column2=@c2 , column3=@c3 

if combo1 , combo3 all

select* table column2=@c2  

... in code selected value of combo , upon query.

is there way thing without generating all 8 types of queries?

ps. cannot use stored procedures because i'm using sql server compact

if value 'all' should sent query value 'null'

select *  table  (column1=@c1 or @c1 null) , (column2=@c2 or @c2 null) , (column3=@c3 or @c3 null) 

edit: of course same can done specified 'all'-value example of 'all' = -1

(column1=@c1 or @c1 = -1) 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -