[Gambas-user] TableView Data from database

Bruce bbruen at ...2308...
Sat Sep 29 04:39:36 CEST 2012


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






More information about the User mailing list