Wow, it was Friday and I had turned my brain off for the weekend. Thanks!
>That all depends ... does it return nothing if there's a problem or does it throw an exception? (I don't use ExecuteScalar, so I'm not sure).
>
>If it throws an exception, then you'll have to use a try/catch.
>
>If it just returns nothing, then I'd do this:
>
>result = cmd.ExecuteScalar()
>if (result is not nothing) 'is this correct VB syntax?
> result = result.ToString
>else
> result = ""
>endif
>
>
>~~Bonnie
>
>
>
>>Is there a graceful way of modifying the following line of code to test if the Command returns Nothing (besides catching the Exception thrown)?
>>
>>
>>result = cmd.ExecuteScalar().ToString
>>