Object Reference Error in ExecuteQuery


#1

I’m trying to run an ExecuteQuery that will output to a variable. The variable is set as a DataTable. The ExistingDbConnection is correct. Validate says no issues. Then I get Object reference not set to an instance of an object. Both query and variable have the same format/layout as another section that works fine. Can someone tell me what I’m missing?

Thanks.


#2

hi @RichTHD
before giving the execute query did you use Connect
if used means what query you have inserted in execute query

Thanks
Ashwin S


#3

That was it. I had my connection piece after my query because I was testing a new query. It didn’t hit me that I wasn’t yet making the connection to the database. Thank you for the help. It worked great!


#4

Check whether the Database connection is open. More over Are you passing any values which are blank in a query?