1. Download our Official Android App: Forums for Android!

Apps issue in controlling SQL query execution

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

  1. realmilan

    realmilan Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 12, 2017

    Aug 12, 2017
    6
    1
    15
    Male
    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?
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,452
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,452
    10,737
    1,988
    Male
    Software developer
    South West of England
    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. realmilan

    realmilan Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 12, 2017

    Aug 12, 2017
    6
    1
    15
    Male
  4. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,452
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,452
    10,737
    1,988
    Male
    Software developer
    South West of England
    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.  
     
  5. realmilan

    realmilan Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 12, 2017

    Aug 12, 2017
    6
    1
    15
    Male
    Dear I request from you to chat, so I can clearly let you know my issue.
    Please, How can we chat?

    Regards,
     
  6. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,452
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,452
    10,737
    1,988
    Male
    Software developer
    South West of England
    I can get a clear understanding of the issue if you post the stack trace.
     
  7. realmilan

    realmilan Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 12, 2017

    Aug 12, 2017
    6
    1
    15
    Male
    I did not get (stack trace)

    Show me an exaple of it, please
     
  8. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,452
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,452
    10,737
    1,988
    Male
    Software developer
    South West of England
    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.
     
  9. realmilan

    realmilan Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 12, 2017

    Aug 12, 2017
    6
    1
    15
    Male
    I shows erroe without the cash block. show me an example of a connection without cash block

     
  10. realmilan

    realmilan Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 12, 2017

    Aug 12, 2017
    6
    1
    15
    Male
    Dear, Please help me .. I really need for this :'( :(
     
    sweetndreemy73 likes this.

Share This Page

Loading...