I want to create an android application that can run SQL Query to my SQL Server Database.
Here is my basic idea:
- I create an android application with 1 textbox and 1 button.
- Users can write the query that they want (e.g. INSERT INTO..,
UPDATE.., DELETE.., or EXEC [store procedure]) in the textbox. - Then users press the button to execute that query to run in my SQL
Server Database.
What I’ve made so far is an Android Application using phonegap + jQuery Mobile and I can get some data from my WCF Service with JSON that connect to my SQL Server, but now I want to run some query that I write from android application and run it to my database. Is it possible? Can you tell me the recommendation tutorials? Thanks 🙂
It can be done.
Create an Android application with an EditText and a Button.
Users can type the query to run (e.g. INSERT INTO.., UPDATE.., DELETE.., or EXEC [store procedure]) into the EditText.
You could do this like below to make it more user friendly.
Give users some options for Insert/Update/Delete via buttons.
Add a Spinner with all the table names.
If the user select a table name, show some _EditText_s for all the columns you need to get a value from the user.
Also you can make separate methods to call accordingly, with required inputs. It will be less complex more user friendly.
I don’t know if it Is makes any sense.