lundi 23 novembre 2015

I need help for getting SQLite data

I use this method for retrieving my data

 public String getdata() {
 String[] columns= new String[]{RowId,RowBusinessName};
 Cursor c=OurDatabase.query(TableName,columns,null,null,null,null,null);
 String Result="";
 int iRowId=c.getColumnIndex(RowId);
 int iRowBusinessName=c.getColumnIndex(RowBusinessName);
 for(c.moveToFirst();!c.isAfterLast();c.moveToNext()){
 Result=Result+c.getString(iRowBusinessName)+"\n";
 }
 return Result;

}

How can I make it return structured data (id & business_name)?
I want to display every business_name in a single textview.

Please help

Aucun commentaire:

Enregistrer un commentaire