Re: [gnome-db] DbGrid



On Wed, 2001-09-05 at 02:37, Juan Andrés Bentancour wrote:
> 
> Hi, friends...
> I' am in problems again. I'm trying  to use DBGrid (gnome-db-grid), 
> After I made the connection, dbgrid widget  shows recordset fields 
> names  in the columns, but dont appear any row of data.
> 
> rs = gda_recordset_new ();
> gda_recordset_set_connection (rs,cnc);
> gda_recordset_open_txt (rs,"select * from 
> prueba",GDA_OPEN_FWDONLY,GDA_LOCK_OPTIMISTIC,0); 
>
it is better if you just use:

GdaRecordset *recset;
gulong reccount;

recset = gda_connection_execute (cnc, "select * from prueba", &reccount,
0);
gnome_db_grid_set_recordset (grid, recset);
gda_recordset_free (recset);

The call to gda_recordset_free is needed since the GnomeDbGrid widget
keeps an internal reference to the GdaRecordset, so you must free it on
this side
  
> gda_recordset_move_first (rs);
>
this is not needed at all. You just can remove it.

> gnome_db_grid_set_recordset( GNOME_DB_GRID(dbgrid1), rs );
> gnome_db_grid_refresh( dbgrid1 );
>
also, gnome_db_grid_refresh is not needed at all. In fact, this function
is broken, so don't use it (I'll remove it from the headers)
 
cheers
-- 
Rodrigo Moya <rodrigo gnome-db org> - <rodrigo ximian com>
http://www.gnome-db.org/ - http://www.ximian.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]