Forum: wxRuby gridtablebase with sql

2aa32559134aa3d596fb749f8ffccde7?d=identicon&s=25 hendra kusuma (Guest)
on 2010-03-15 05:54
(Received via mailing list)
Dear all

How do I use gridtablebase to display record I get from sql?

I try to follow the help and sample,
but I don't understand how to combine the sql data

sample code would be good

Thank you
Regards
Hendra
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2010-03-15 07:35
(Received via mailing list)
Hi Hendra

On 15/03/2010 04:53, hendra kusuma wrote:
> How do I use gridtablebase to display record I get from sql?
>
> I try to follow the help and sample,
> but I don't understand how to combine the sql data
>
> sample code would be good

Someone else may have some code to offer, but I'm afraid most people
don't have time to write a complete code sample. Your class should
inherit from Wx::GridTableBase and there's a set of method that your
class must provide to provide the SQL results to the table.The
documentation is there; the sample has some comments and can be used as
a template. It's probably worth looking at it again, understanding what
each method is doing, then having a go yourself. If you get stuck on
something specific, I'd be happy to help.

best
alex
2aa32559134aa3d596fb749f8ffccde7?d=identicon&s=25 hendra kusuma (Guest)
on 2010-03-15 08:43
(Received via mailing list)
On Mon, Mar 15, 2010 at 1:35 PM, Alex Fenton <alex@pressure.to> wrote:

>> sample code would be good
> best
> alex
>
>
Thank you Alex, you are always helpful
I finally figure it out
so to put it simpy, all I need is 2 dimension array of my sql result
and put it in
def get_value(row, col)
   (sql_result[row])[col].to_s
end

I found that each time i modify sql result
I need to recreate the object
to avoid error caused by difference in row number

well, thats enough for the time being :)

Thank you
Regard
Hendra
This topic is locked and can not be replied to.