[gnome-db] Need Help for libgdata in GTK programing



Hello Sir,
I am fresher in development for linux.

I know this is very basic and silly question, but i stuck here.

I am trying to set the text of lable with the value whatever is returned by
database select query, i.e. label should be set as "vedesa1" but is getting
set as "shopid ───────vedesa1(1 row)"

i think i need to use "gda_data_model_get_value_at" function to get the
sting "vedes1"  , but somehow with lack of experience i am not ablw to use
it, cam someone please help me out 



* Table shop contailns single entry as 

shopid 
───────
vedesa1




* command line used to compile the code is 
gcc `pkg-config --cflags gtk+-3.0`  -o SAMPLE SAMPLE.c `pkg-config --libs
gtk+-3.0` `pkg-config --cflags --libs libgda-5.0`


*  existing code  snipet is as follows

GdaDataModel *data_model0 , *data_model1;
GdaSqlParser *parser;
GdaStatement *stmt0 , *stmt1;
gchar *sql1 = "SELECT shopid  FROM shop";
GError *error = NULL;
GValue *value1;
        
parser = g_object_get_data (G_OBJECT (cnc), "parser");
        
stmt1 = gda_sql_parser_parse_string (parser, sql1, NULL, NULL);
        
data_model1 = gda_connection_statement_execute_select (cnc, stmt1, NULL,
&error);
g_object_unref (stmt1);
if (!data_model1) 
                g_error ("Could not get the contents of the 'products'
table: %s\n",error && error->message ? error->message : "No detail");

        g_print("above gda_data_model_dump \n");
        gda_data_model_dump (data_model1, stdout);


        g_print ("\nin g_print %s", gda_data_model_dump_as_string(data_model1));


(GTK_ENTRY(entry1),gda_data_model_dump_as_string(data_model1));
        gtk_entry_set_text (GTK_ENTRY(entry1),value1);
        


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