[Gambas-user] TableView Data from database

rocko sunblaster5 at ...626...
Sat Sep 29 05:11:38 CEST 2012


Ok that makes a little more sense.
But I have some questions.

Do I have to use a TableView?
Originally I used DataView but that displays all
the fields in the database, I just want to use some
of the fields if certain conditions apply, like
if the 'Days Left' field is less than 20 days.

Then if so display just 4 fields in a separate
Dataview/TableView.

Now exactly what is the 'idx' variable you used?
Is it just an integer used to count thru the loop.

I ask cause I tried your example and it's not working.
I don't get any error's, just the TableView is not being
filled with any data.



On 09/28/2012 07:39 PM, Bruce wrote:
> On Fri, 2012-09-28 at 19:27 -0700, rocko wrote:
>> Huh?
>> I'm sorry Bruce I'm not following.
>> I want the fields to update when the form opens.
>> Just the ID, Location and Days Left fields.
>>
> Unless a row is selected in the tableview, Tableview1.Row will be -1.
> (You can check that in the debugger.)  So your sResult!location =
> TableView1[TableView1.Row, 1].Text line reports the Bad Row Index error
> as TableView1[-1, 1].Text is incorrect.
> If you want the update to happen automatically when the form opens you
> will have to iterate through the rows of the tableview explicitly. As
> in 
> For idx = 0 to TableView1.Rows.Max
>   ...
>   sResult!location = TableView1[idx, 1].Text
>   ...
> Next
> 
> Bruce
> 
> 
>>
>> On 09/28/2012 07:17 PM, Bruce wrote:
>>> On Fri, 2012-09-28 at 18:55 -0700, rocko wrote:
>>>> I get a "Bad Row Index" error when I do that.
>>>>
>>>>
>>>> On 09/28/2012 12:07 AM, Алексей Беспалов wrote:
>>>>> It do that:
>>>>>
>>>>>  sResult = DB.Edit("inventory", id = &1, ID)
>>>>>   sResult!id = ID
>>>>>   'sResult!location = TableView1.Columns[1].
>>>       If TableView1.Row < 0 then Error.Raise("You haven't selected a row
>>> in the tableview yet!")
>>>>> *  sResult!location = TableView1[TableView1.Row, 1].Text*
>>>>>   sResult.Update
>>>>>
>>>
>>> hth
>>> Bruce
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> How fast is your code?
>>> 3 out of 4 devs don\\\'t know how their code performs in production.
>>> Find out how slow your code is with AppDynamics Lite.
>>> http://ad.doubleclick.net/clk;262219672;13503038;z?
>>> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>> ------------------------------------------------------------------------------
>> How fast is your code?
>> 3 out of 4 devs don\\\'t know how their code performs in production.
>> Find out how slow your code is with AppDynamics Lite.
>> http://ad.doubleclick.net/clk;262219672;13503038;z?
>> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 
> 
> ------------------------------------------------------------------------------
> How fast is your code?
> 3 out of 4 devs don\\\'t know how their code performs in production.
> Find out how slow your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219672;13503038;z?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 




More information about the User mailing list