Piotr Pokora <[EMAIL PROTECTED]> wrote:
 
> However , I am a bit confused now.
> Is gda_data_model_get_column_index_by_name correctly implemented then?
> It uses gda_data_model_get_n_columns, which can not work ( and does not ).


This does not work ( or I do something odd )

nbcols = gda_data_model_get_n_columns (model);
        for(ncol = 0; ncol < nbcols; ncol++) {
                if(g_str_equal (name, gda_data_model_get_column_title (model, 
ncol))) {

                        ret = ncol;
                        break;
                }
        }

This works without any problem:

nbcols = gda_data_model_get_n_rows (model);
        for(ncol = 0; ncol < nbcols; ncol++) {
                const GValue *value = gda_data_model_get_value_at(model , 0, 
ncol);
                if(g_str_equal (name, g_value_get_string(value))) {
                        ret = ncol;
                        break;
                }
        }

Or at least I created model with the parameters I mentioned here.

Piotras
_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list

Reply via email to