• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps issue in controlling SQL query execution

realmilan

Lurker
Hi there,

I hope to fine my solution here..

I am developing an app that retrieve data from SQL Server.
I have to execute 2 queries together to come out with result. The problem is the first query is a Stored Procedure that contain (INSERT INTO... EXEC sp_....), this query is shows error in server side but it is executed well, then the second query will read from the inserted result into it sue the first query.

The problem is, when the fist query execute, it make the App goes to Exception part witch not allow the second query to be executed.
Is there any way to make Android Studio ignore the error and execute the second query?
 
Difficult to answer this from the information you've given. Please show the following:-

1. Stack trace from the Logcat
2. The relevant parts of code from your app
 
So what is the exception?
As I said previously, we need to see the stack trace from your Logcat.
This block of code will effectively stop you seeing the actual exception, so you should remove it, or re-throw the exception.

Code:
catch (Exception ex)
           {
               message = "Error";
           }
 
I can get a clear understanding of the issue if you post the stack trace.
 
You're not seeing a stack trace because you catch the exception and do nothing with it. As stated above, remove the catch block from your code.
 
I shows erroe without the cash block. show me an example of a connection without cash block

You're not seeing a stack trace because you catch the exception and do nothing with it. As stated above, remove the catch block from your code.[/QUOTE
 
Back
Top Bottom