[Gambas-user] TableView Data from database
rocko
sunblaster5 at ...626...
Sat Sep 29 03:55:09 CEST 2012
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].
> * sResult!location = TableView1[TableView1.Row, 1].Text*
> sResult.Update
>
> 2012/9/28 rocko <sunblaster5 at ...626...>
>
>> I'm using a Table view to view data from an SQLite database.
>> I would use a dataview but I only need to display some database fields
>> not all of them.
>>
>> This is the code I have so far:
>> Public Sub Form_Open()
>>
>> Dim sResult As Result
>> Dim id As Integer
>>
>> TableView1.Columns.Count = 3
>> TableView1.Rows.Count = 10
>>
>> TableView1.Columns[0].Title = ("ID")
>> TableView1.Columns[0].Width = (TableView1.Width / 10) * 2
>> TableView1.Columns[1].Title = ("Location")
>> TableView1.Columns[1].Width = (TableView1.Width / 10) * 4.5
>> TableView1.Columns[2].Title = ("Days Left")
>> TableView1.Columns[2].Width = (TableView1.Width / 10) * 2
>>
>> sResult = DB.Edit("inventory", id = &1, ID)
>> sResult!id = ID
>> sResult!location = TableView1.Columns[1].
>> sResult.Update
>>
>> I obviously get an error at runtime on the second to last line as I'm
>> not sure how to put data from the database into the table column.
>>
>> I believe I asked this question before using a dataview on how to
>> display only some data from the database as using a dataview would be
>> easier but I never got a response so I'm trying a table view as it has
>> more options--at least I think so.
>>
>> Any help would be appreciated.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://ad.doubleclick.net/clk;258768047;13503038;j?
>> 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