[Gambas-user] display database in gridview

Arkadiusz Zychewicz oczykota at ...988...
Fri Jun 17 01:09:51 CEST 2005


fabien napisał(a):
> Le Jeudi 16 Juin 2005 22:51, Arkadiusz Zychewicz a écrit :
> 
> send me your code
Ok. As you wish:
SUB pokazBaze()
   DIM rData AS Result
   DIM r AS Integer
   DIM c AS Integer

   FMain.$dbPr.Open
   IF FMain.$dbPr.Tables.Exist("Produkty") THEN Label6.Text = "JEST"
   rData = FMain.$dbPr.Create("Produkty")
   gv1.Columns.Count = 7
   gv1.Rows.Count = 10


   rData.MoveFirst
   FOR r = 0 TO 3 STEP 1
   FOR c = 0  TO 1 STEP 1
    gv1[r,c].Text = rData!id
    'i try also :
    'gv1[r,c].Text = Str(rData["id"])
    'and it's same effect
    rData.MoveNext
   NEXT
   NEXT

   FOR EACH rData
     PRINT rData!id; " "; rData!vat
   NEXT
FMain.$dbPr.Close
END

in Label6 is shows a text JEST so tables exist.


I ask for something different.
I also want to fill base but i have problem with auto increment column, 
because i don't known how to fill it?
i try
rDate["id"] = rData.Count
or
rDate["id"] = rData.Count + 1

And i don't known how make this column auto increment that it increment 
by self.
(base which i use is sqlite)

Arek.





More information about the User mailing list