473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

autocompletetextview in android using cursor for select query

hi

I want autocompletetextview in android here we are using sqlite database with query using cursor.

Expand|Select|Wrap|Line Numbers
  1. public void cal()
  2. {
  3.     SQLiteDatabase db= null;
  4.     String TableName = "enquiryhead";
  5.     db = openOrCreateDatabase("DatabaseName", SQLiteDatabase.CREATE_IF_NECESSARY, null);
  6.     db.setVersion(1);
  7.     db.setLocale(Locale.getDefault());
  8.     db.setLockingEnabled(true);
  9.     Cursor c = db.rawQuery("SELECT splr_nm FROM " + TableName , null);
  10.     int Column1=c.getColumnIndex("splr_nm");
  11. //Check if our result was valid.
  12.     //Data=Data+"OrderNo  | Date  |  SuppierName"+"\n";
  13.     int k=0;
  14.     c.moveToFirst(); 
  15.     if (c != null)
  16.     { 
  17.      // Loop through all Results
  18.         item = new String[Column1];
  19.      do { 
  20.          String sname=c.getString(Column1);
  21.            item[k]=sname;
  22.           k++;                
  23.             }while(c.moveToNext());
  24.     }
  25.  

The above code is retrieve data from data base and assign to item, i.e item is string, but its not working
Aug 16 '10 #1
0 2332

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: MLH | last post by:
I have a table (tblCorrespondence) holding records with fields like , , , , , , , etc... About a dozen 's are defined and I often use queries to extract records of a given . That's pretty easy....
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
5
by: parwal.sandeep | last post by:
Hello grp! i'm using INNODB tables which are using frequently . if i fire a SELECT query which fetch major part of table it usually take 10-20 seconds to complete. in mean time if any UPDATE...
0
by: anonieko | last post by:
This approach I found very efficient and FAST when compared to the rowcount, or Subquery Approaches. This is before the advent of a ranking function from DB such as ROW_NUMBER() in SQL Server...
1
by: Phil | last post by:
Is it possible to swap rows and columns in select query output so that each record's data is displayed in a column? I want to collect data each day and display it in a query with each day's date...
2
by: cherylwalsh35 | last post by:
I am working in access - using a select Query. I am including a memo field. The table has all of the data in the memo field displayed - however when I run a select query and include the memo...
3
by: RAG2007 | last post by:
I'm using the QueryDef and Execute method to update a record in my MySQL backend. Problem: When the Passthrough update query is defined using QueryDef, it becomes a select query, and I cannot use...
1
by: atishrg | last post by:
Hello All, I am facing one strange problem.. I am using a select query in my function which will return specified product details according to product code selected by user.. here is the...
2
by: paulmitchell507 | last post by:
I think I am attempting a simple procedure but I just can't figure out the correct syntax. My asp (classic) page runs a SELECT query to obtain dates and ID's from 2 tables uSQL = "SELECT...
4
by: scottie | last post by:
Hi Everyone. First time here and what a site, my hat off to all the boffins here. I have looked though the forum and have found many interesting threads and could spend hours just crusing though the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.