Android Question HOW CAN I FILL SPINNER2 WHILE CHANGING SPINNER 1 WITH CONDITION

manuaaa

Member
Licensed User
Longtime User
Hi, I have two spinner, I want to fill spinner 2 with condition value of spinner 1, Kindly help me - Thanks - Manoj
 

manuaaa

Member
Licensed User
Longtime User
DEAR KLAUS SIR,
I AM DOING IT THROUGH MSSQL WITH THE FOLLOWING CODE BELOW GIVEN IS MY CODE TO GET DATA FROM WEBDATABASE. HOW CAN I DO IT WITH SQLLITE WITH LOCAL DATA BASE - PLEASE HELD ME

a.setDatabase("xxx.xxx.xx.x","manwin","xxxxxxxx","xxxxxxxx")
L = a.Query("SELECT REPORTINGTO FROM fs where name = '" & Login.Text & "' ")
For i = 1 To L.Size -1
strColumn=L.Get(i)
strColumn= strColumn.Replace("[","").Replace("]","")
Spinner2.Add(strColumn)
MgtTxt.Text = strColumn
Next
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Did you have a look at the examples in SQLiteLight three simple SQLite projects in my signature ?

You need to initialize the database SQL1.
And:
B4X:
Dim Cursor1 As Cursor
Cursor1 = SQL1.Query("SELECT REPORTINGTO FROM fs where name = '" & Spinner1.SelectedItem & "' "
For i = 0 To Cursor1.Size -1
    Cursor1.Position = i
    strColumn=Cursor1.GetString(ColumnName)
    strColumn= strColumn.Replace("[", "")
    Spinner2.Add(strColumn)
    MgtTxt.Text = strColumn
Next
Cursor1.Close
 
Upvote 0

manuaaa

Member
Licensed User
Longtime User
NOT WORKING SIR, THIS IS MY UPDATED CODE - PLEASE HELP

Dim Query As String
Dim SQL1 As SQL
Dim cursor1 As Cursor
SQL1.Initialize(File.DirDefaultExternal, "amritham.sql", False)
cursor1 = SQL1.Query("SELECT HOSPNAME FROM TAB_HOSP_EMP_MAP where AREA = '" & Spinner1.SelectedItem & "' "
For i = 0 To cursor1.Size -1
cursor1.Position = i
strColumn=cursor1.GetString("HOSPNAME")
strColumn= strColumn.Replace("[", "")
Spinner2.Add(strColumn)
MgtTxt.Text = strColumn
Next
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sorry, this SQL1.Query("SELECT... must be SQL1.ExecQuery("SELECT...
You also need to Initialize the database !

Did you have a look at the examples SQLiteLight three simple SQLite projects in my signature, as already suggested ?

You should look at chapter 4 SQLite Database in the User's Guide.
 
Upvote 0
Top