there can be variable number of params being sent through a query string. in my form the query sends a few params that may not always be filled i.e. they will be sent as id="". this means that the function being used in my TableAdapter will bring the wrong result if one param is not coming in. i.e. it recieved 7 params whereas it was expecting 8 (or the 8th will be NULL).
The only workaround i can think is to make overloaded functions. but that means i will have to make 64 overloaded functions (for 8 params). Too much work, which makes me think that there maybe some other way i could get the job done without making 64 functions.
Is there any?
Working on ASP.NET with MSSQL
There is one work around we are using and It works perfectly for us.
You don’t need to make any overload functions. You can pass all the parameter’s values and If there is an empty value you can simply pass
'%'and you don’t need to do anything with the query either. Here is an example of an SQL Query:If you check the above query in SQL server it will give you correct result.
Note: I have not tested this with
TableAdapter, But I am sure it will work.