i'm trying data sqlite database.tried using thiscontext.getcontentresolver().query() method , got following sqlexception
near ":23": syntax error (code 1): , while compiling: select wol_wait, mac_addr, _id, address, name, wol_port, user, timeout, pass hosts (mac_addr=00:23:15:97:ce:a0) order name asc this code i’m using
cursor c=context.getcontentresolver().query(hostprovider.hosts.content_uri,null, hosts.mac_addr +"=" +string.valueof(mhost.mac_addr),null,hostprovider.hosts.name + " asc"); how can fix issue?
string literals such mac addresses need in 'single quotes', or better yet, use ? placeholders , variable binding. replace
hosts.mac_addr +"=" +string.valueof(mhost.mac_addr),null with
hosts.mac_addr +"=?", new string[] { string.valueof(mhost.mac_addr) } the string.valueof possibly not needed.
Comments
Post a Comment