Passing value from spinner

stevieg

Member
Licensed User
Longtime User
I am new to B4Android so pardon my question if it seems obvious to everyone. I have a Spinner control that list the States that the Customers are in. When the user selects the Sate, I pass that value to the Dbutils routine below, but There is a problem with the "Value" not being the correct type for the routine to process it. I have tried various scenarios but cannot get it to work. Any suggestions?


Sub spinState_ItemClick (Position As Int, Value As Object)

wvCustomers.LoadHtml(DBUtils.ExecuteHtml(SQL1, "SELECT CustName as Name,City,StateID as State,Postalcode as Zip FROM Customers where trim(StateID) = ? order by CustName " , Value , 0,True))
wvCustomers.Visible=True

End Sub

:sign0163:
 

stevieg

Member
Licensed User
Longtime User
Thanks, but I did see that in one of your examples and tried it but got no results returned.

If I force a value like:

wvCustomers.LoadHtml(DBUtils.ExecuteHtml(SQL1, "SELECT CustName as Name,City,StateID as State,Postalcode as Zip FROM Customers where trim(StateID) = ? order by CustName " ,Array As String("MA"), 0,True))

Then the results show up in my webview.

But, if I select MA from the spinner and use:

wvCustomers.LoadHtml(DBUtils.ExecuteHtml(SQL1, "SELECT CustName as Name,City,StateID as State,Postalcode as Zip FROM Customers where trim(StateID) = ? order by CustName " ,Array As String(Value), 0,True))

Nothing shows up in the webview.

I am perplexed. Should I force single or double quotes around (Value)?
 
Upvote 0
Top