Thanks Guys, Using rawQuery()it works.

On Nov 11, 11:25 pm, Kumar Bibek <[email protected]> wrote:
> It's not mandatory to use the primary key.
>
> On Thu, Nov 11, 2010 at 4:29 PM, Ravi Shankar Kumar 
> <[email protected]>wrote:
>
>
>
> > plz use primary key that is generally autoincreamented key for any
> > particular row identification
>
> > On Thu, Nov 11, 2010 at 4:15 PM, pramod.deore 
> > <[email protected]>wrote:
>
> >> Logcat gives me following output
>
> >> 11-11 16:13:13.031: ERROR/Database(709): Failure 1 (no such column:
> >> BathRoom) on 0x145618 when preparing 'SELECT RoomID FROM roomtable
> >> where RoomName=BathRoom'.
> >> 11-11 16:13:13.159: WARN/System.err(709):
> >> android.database.sqlite.SQLiteException: no such column: BathRoom:
> >> SELECT RoomID FROM roomtable where RoomName=BathRoom
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:
> >> 1610)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> com.monarch.home.AddRoom.onActivityResult(AddRoom.java:349)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.app.Activity.dispatchActivityResult(Activity.java:3828)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.app.ActivityThread.deliverResults(ActivityThread.java:3325)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.app.ActivityThread.handleSendResult(ActivityThread.java:3371)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.app.ActivityThread.access$2700(ActivityThread.java:119)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1893)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.os.Handler.dispatchMessage(Handler.java:99)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.os.Looper.loop(Looper.java:123)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> android.app.ActivityThread.main(ActivityThread.java:4363)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> java.lang.reflect.Method.invokeNative(Native Method)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> java.lang.reflect.Method.invoke(Method.java:521)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> com.android.internal.os.ZygoteInit
> >> $MethodAndArgsCaller.run(ZygoteInit.java:860)
> >> 11-11 16:13:13.159: WARN/System.err(709):     at
> >> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
> >> 11-11 16:13:13.286: WARN/System.err(709):     at
> >> dalvik.system.NativeStart.main(Native Method)
>
> >> On Nov 11, 11:50 am, "pramod.deore" <[email protected]> wrote:
> >> > Hi ,
>
> >> > I have a table in that there is 2 columns. Now I want to retrieve the
> >> > value of one column using value of second column (Means suppose my
> >> > table name is roomtable. and it contains 2 columns as RoomID and
> >> > RoomName)
>
> >> >     Now I know value of RoomName and I want to find out value of
> >> > RoomID. How to this?
> >> > I had tried using following but not succeed.
>
> >> > final String ROOM_TABLE_NAME = "roomtable";
> >> > sampleDB =  this.openOrCreateDatabase(SAMPLE_DBNAME, MODE_PRIVATE,
> >> > null);
>
> >> > sampleDB.execSQL("SELECT RoomID FROM " +ROOM_TABLE_NAME+"where
> >> > RoomName="+selectedRoom);
>
> >> > how to execute this query so I can get RoomID?
> >> > Thanks
>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Android Developers" group.
> >> To post to this group, send email to [email protected]
> >> To unsubscribe from this group, send email to
> >> [email protected]<android-developers%[email protected]>
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-developers?hl=en
>
> >  --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to