[Gambas-user] A question for Lee

Gianluigi gradobag at gradobag.it
Thu Aug 10 22:51:10 CEST 2023


Il 10/08/23 20:45, T Lee Davidson ha scritto:
> On 8/10/23 12:52, Gianluigi wrote:
>> Also, instead of using a loop, we can just as well use the sub 
>> GridView1_Data.
>
> And, if using a GridView, the columns can be set up as follows:
> [code]
> Public Sub Form_Open()
>
>   Dim hConn As Connection = Connections["Connection1"]
>   Dim hResult As Result
>   Dim iColNum As Integer
>
>   hConn.Open
>   hResult = hConn.Exec("select * from `my_table` limit 0")
>   GridView1.Columns.Count = hResult.Fields.Count
>   For Each hField As ResultField In hResult.Fields
>     GridView1.Columns[iColNum].Title = hField.Name
>     Inc iColNum
>   Next
>
> End
> [/code]
>

Hi Lee,

nice trick, i wouldn't have thought of that.👍
Here's one reason not to use the shortened names I like so much :-(
(it's night here, I'm going to sleep, tomorrow garden)

Regards

Gianluigi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230810/2ca4b68e/attachment.htm>


More information about the User mailing list