开发者

How to display data from sqlite in textview

i have a problem... How to display data from开发者_运维技巧 sqlite in textview..

please help me out..

Thank u..


i am giving u a simple database table,in which u should define roll no, name , marks and through roll no u can fetch related data through cursor...

private void getStudent() 
{
    // TODO Auto-generated method stub
    int roll_no = Integer.parseInt(rollText.getText().toString());

    Cursor c = db.getStudent(roll_no);

    if(c.moveToFirst())
    {
        nameText.setText(c.getString(1));
        marksText.setText(c.getString(2));
    }

}

create project and call like this function in clickevent...

i think you understand it...

all the best...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜