数据库Log之Couldn't read row 0, col -1 from CursorWindow

今天写代码,日志报出了一个很奇葩的错误。在CursorWindow的信息是Couldn‘t read row 0, col -1

这个错误一般是从sqlite查数据的时候照不到指定的列,或数据类型不匹配。避免这些低级错误最好养成良好的编程习惯,比如写成“cursor.getString(cursor.getColumnIndex("xxx"))”而不是“cursor.getString(3)”。

再有的一点可能是db = dbHelper.getReadableDatabase();而实际上db = dbHelper.getWritableDatabase();

这个错误就是在构造函数db = dbHelper.getWritableDatabase();初始化后,在后面查询数据忘了改过来

数据库Log之Couldn't read row 0, col -1 from CursorWindow

时间: 2024-10-11 13:51:19

数据库Log之Couldn't read row 0, col -1 from CursorWindow的相关文章

java.lang.IllegalStateException: Couldn't read row 0, col 2 from CursorWindow.

java.lang.IllegalStateException: Couldn't read row 0, col 2 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it. 提示说没有找到相应的关键字段,查看数据库的字段是否写对,此时是区分大小写的 java.lang.IllegalStateException: Couldn't read row 0, c

java.lang.IllegalStateException:Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx...}: java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it.  要检查列名拼写!列名拼

Couldn't read row 0, col -1 from CursorWindow

java.lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it. c.getString(c.getColumnIndex("_ID")//字段名称不正确 Couldn't read row 0, col -1 from CursorWin

Xamarin.Android 使用 SQLite 出现 Couldn't read row 0, col -1 from CursorWindow. 异常

异常:Java.Lang.IllegalStateException: Couldn't read row 0, col -1 from CursorWindow.  Make sure the Cursor is initialized correctly before accessing data from it. 出现该问题一般分为两种情况: 1.请求的字段不在表中,可能是大小写没写对.(我就是Id写成id出现的错误) 2.字段类型不匹配. Xamarin.Android 使用 SQLit

Oracle Alert日志出现Incremental checkpoint up to RBA [0x5d02.5e5b.0], current log tail at RBA [0x5d02.7b8b.0]

可能新巡检某台Oracle数据库服务器alert日志会忽然发现有如下输出: Wed Nov 21 05:46:04 2018 Incremental checkpoint up to RBA [0x5d02.5e5b.0], current log tail at RBA [0x5d02.7b8b.0] Wed Nov 21 06:06:05 2018 Incremental checkpoint up to RBA [0x5d02.dfe7.0], current log tail at RB

学习时用的软件最新 开发环境为Visual Studio 2010,数据库为SQLServer2005,使用.net 4.0开发。 超市管理系统

一.源码特点 1.采用典型的三层架构进行开发.模板分离,支持生成静态 伪静态..购物车.登陆验证.div+css.js等技术二.功能介绍 1.本源码是一个超市在线购物商城源码,该网上商城是给超市便利店等零售批发实体店定制的网上商城,主要针对周边配送,后台可定义配送范围,可在线支付和货到付款! 2.用户注册,需要填写正确手机号码 获得验证码输入正确才能注册成功,保证用户信息的准确性,真实性.其它在线购物商城的常规功能,该系统都有,非常适合学习或二次开发使用,欢迎下载三.菜单功能       前台页

oracle11g 数据库导出报“ EXP-00003: 未找到段 (0,0) 的存储定义”错误的解决方案

导出oracle11.2.0.2的服务器的数据时,报"EXP-00003: 未找到段 (0,0) 的存储定义"错误.初步分析是由于数据表是空表导致该问题. Oracle 11G在用EXPORT导出时,空表不能导出 11GR2中有个新特性,当表无数据时,不分配segment,以节省空间 解决方法:一. insert一行,再rollback就产生segment了. 该方法是在在空表中插入数据,再删除,则产生segment.导出时则可导出空表.二. 设置deferred_segment_cr

DataTables warning: TABLE id=DataTables_Table_0 - Requested UNKNOWN parameter '7' FOR ROW 0

使用H-ui.admin或者DataTables的人都难免会碰到: DataTables warning: TABLE id=DataTables_Table_0 - Requested UNKNOWN parameter '7' FOR ROW 0. FOR more information about this error, please see http://datatables.net/tn/4 此错误,结果去了DataTables官网手册也没看懂怎么解决. 耐着着急的赶项目的心,仔细去

The 'to' row (0) must not be less than the 'from' row (1)

1.错误描述 Exception in thread "main" java.lang.IllegalArgumentException: The 'to' row (0) must not be less than the 'from' row (1) at org.apache.poi.hssf.model.InternalSheet.addMergedRegion(InternalSheet.java:513) at org.apache.poi.hssf.usermodel.H