J
JDS
I want to be able to use effectively a table adaptor query that can
take several arguments with several of those arguments possibly null.
I have not been able to do this elegantly.
When I first came across nullable types I thought this may provide the
answer but sadly not. I can't just pass the variable value if it is
null (or nothing) but have to check HasValue first and if not pass
Nothing directly. This seems to completely miss what I thought was the
potential benefit.
So back to the original problem. What is the most effective way to
pass several arguments to a table adaptor query when several of them
could be null? Checking each value first with a whole series of if
statements is not practical when you get more than a couple of
variables with the number of possible permutations. I did come up with
one solution using a data row but this did not seem very efficient.
Am I missing something? Is there an effective way of doing this?
take several arguments with several of those arguments possibly null.
I have not been able to do this elegantly.
When I first came across nullable types I thought this may provide the
answer but sadly not. I can't just pass the variable value if it is
null (or nothing) but have to check HasValue first and if not pass
Nothing directly. This seems to completely miss what I thought was the
potential benefit.
So back to the original problem. What is the most effective way to
pass several arguments to a table adaptor query when several of them
could be null? Checking each value first with a whole series of if
statements is not practical when you get more than a couple of
variables with the number of possible permutations. I did come up with
one solution using a data row but this did not seem very efficient.
Am I missing something? Is there an effective way of doing this?