0

这段代码对我有用:

SQL = "SELECT _id,Fname,Lname,Phone,Car,CarNum,PicNum from MEN order by Lname,Fname";
.
.
public void update_list(String NN) {
       c = db.rawQuery(NN, null);
       startManagingCursor(c);

       String[] from = new String[]{"_id","PicNum","Fname","Lname","Car","CarNum" };
       int[] to = new int[]{  R.id._id,R.id.MyPic,R.id.Fname ,R.id.Lname,R.id.Car,R.id.CarNum };
       SimpleCursorAdapter notes = new SimpleCursorAdapter (this, R.layout.my_list, c, from, to);
       setListAdapter(notes);


setListAdapter(new SimpleCursorAdapter(this, R.layout.my_list, c, from,to) {

但如果我的查询是这样的:

SQL = "SELECT _id,Fname + Lname as Fname,Lname,Phone,Car,CarNum,PicNum from MEN order by Lname,Fname";

我在 Fname 列中得到 0。

4

1 回答 1

1

我认为您使用了不正确的连接运算符。请参阅下面的问题。

如何在sqlite中使用填充连接字符串

于 2012-11-26T19:00:38.123 回答