开发者

How to display data from sqlite in textview

开发者 https://www.devze.com 2023-01-17 05:02 出处:网络
i have a problem... How to display data from开发者_运维技巧 sqlite in textview.. please help me out..

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

精彩评论

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

关注公众号