1. Are you ready for the Galaxy S20? Here is everything we know so far!

issue in controlling SQL query execution

Discussion in 'Android Development' started by realmilan, Aug 12, 2017.

  1. realmilan

    realmilan Lurker
    Thread Starter

    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?
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Deleted User

    Deleted User Guest

    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
     
  3. Deleted User

    Deleted User Guest

    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 (Text):
    1.  
    2. catch (Exception ex)
    3.            {
    4.                message = "Error";
    5.            }
    6.  
     
  4. realmilan

    realmilan Lurker
    Thread Starter

    Dear I request from you to chat, so I can clearly let you know my issue.
    Please, How can we chat?

    Regards,
     
  5. Deleted User

    Deleted User Guest

    I can get a clear understanding of the issue if you post the stack trace.
     
  6. realmilan

    realmilan Lurker
    Thread Starter

    I did not get (stack trace)

    Show me an exaple of it, please
     
  7. Deleted User

    Deleted User Guest

    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.
     
  8. realmilan

    realmilan Lurker
    Thread Starter

    I shows erroe without the cash block. show me an example of a connection without cash block

     
  9. realmilan

    realmilan Lurker
    Thread Starter

    Dear, Please help me .. I really need for this :'( :(
     
    sweetndreemy73 likes this.
Loading...

Share This Page

Loading...