G GuyBooth Active Member Licensed User Longtime User Dec 10, 2018 #1 I want to execute a single ExecNonQuery statement asynchronously, so I obtain a success result. As far as I can see, the only way to do this is to add the query to a batch and execute the batch like this: Code: Copy ' Add the query to a batch so we can run async sqlMB.AddNonQueryToBatch(Query, lstArgs) ' Run the batch asynchronously Wait For (sqlMB.ExecNonQueryBatch("sqlMB")) sqlMB_NonQueryComplete (Success As Boolean) All the other ExecNonQuery statements appear to be synchronous - or am I missing something?
I want to execute a single ExecNonQuery statement asynchronously, so I obtain a success result. As far as I can see, the only way to do this is to add the query to a batch and execute the batch like this: Code: Copy ' Add the query to a batch so we can run async sqlMB.AddNonQueryToBatch(Query, lstArgs) ' Run the batch asynchronously Wait For (sqlMB.ExecNonQueryBatch("sqlMB")) sqlMB_NonQueryComplete (Success As Boolean) All the other ExecNonQuery statements appear to be synchronous - or am I missing something?
Erel B4X founder Staff member Licensed User Longtime User Dec 11, 2018 #2 Your code is correct and looks fine. Upvote 0
MarkusR Well-Known Member Licensed User Longtime User Dec 11, 2018 #3 would ExecQueryAsync work also if it not return a result set? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 11, 2018 #4 I wouldn't use ExecQueryAsync for non-query commands. Upvote 0