Click here to Skip to main content
15,891,745 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Am New to Android.. I want to connect sql server 2008 to android application to display sql server database table in GridView.. PLease Anyone help me by giving procedure and android coding... thanks in advance...
Posted

1 solution

No direct support is there for it, So you can achieve this via Web Service.

See "How to establish the connection between WCF and Android" :

WCF and Android Part I[^]
WCF and Android: Part II[^]

-KR
 
Share this answer
 
Comments
Member 10556609 20-Mar-14 3:25am    
Ya Am using this webservice sir, but i dont know how to bind the returned webservice data in to gridview..Am used sql server for webservice.. then am using alternate format that direct connection android with sql .. this is my code but no response..
public void ConnectToDatabase(){
try {

// SET CONNECTIONSTRING
Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
String username = "username";
String password = "password";
Connection DbConn = DriverManager.getConnection("jdbc:jtds:sqlserver://server name:1433/DBNAME;user=" + username + ";password=" + password);

Log.w("Connection","open");
Statement stmt = DbConn.createStatement();
ResultSet reset = stmt.executeQuery(" selecting querry");


GridView num = ( GridView) findViewById(R.id.gridView1);
num.setFilterText(reset.getString(1));

DbConn.close();

} catch (Exception e)
{
Log.w("Error connection","" + e.getMessage());
}
}
Member 10556609 20-Mar-14 3:26am    
please help me for these two format sir..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900