U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ SQL » sql + editstring
Re: sql + editstring [message #33082 is a reply to message #32350] Wed, 06 July 2011 10:06 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1244
Registered: March 2006
Location: Italy
Senior Contributor
Didier wrote on Tue, 10 May 2011 20:16

Hi begnur,

you can use an 'SqlCtrls' object to achieve what you want.

You can do something like this:

SqlCtrls ctrls;

ctrls(MY_TABLE_Field1, editString1 )
     (MY_TABLE_Field2, editString2)
     (MY_TABLE_Field2, editString3);


void updateDbOnEditString()
{
   Sql sql;
   sql * ctrls.Update(MY_TABLE).Where(MY_TABLE_ID == index);
}

void Query()
{
   ctrls.Load( MY_TABLE, MY_TABLE_ID == index);
}



This is quite handy to use

Another way is to use an SqlArray object and set EditStrings as the controls for the each string field




Hello,

this example is very nice. SqlCtrls seems to have many potentiality but it looks not documented in contrast to SqlArray.
I tried your example but with a droplist instead of editString2 and Insert procedure.
It seems that editString1 pass its value to the table but the droplist miss its task.
May I ask a similar test case with a droplist (containing pairs of key, value).

Thanks,
Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Sqlite Delete not working [SOLVED]
Next Topic: More .sch files?
Goto Forum:
  


Current Time: Fri Sep 11 11:16:36 GMT+2 2026

Total time taken to generate the page: 0.00823 seconds