Home » Community » Newbie corner » sqlarray and sqlite (Trying to use sqlite example but...)
Re: sqlarray and sqlite [message #54998 is a reply to message #54976] |
Sun, 04 October 2020 10:05   |
 |
mirek
Messages: 14264 Registered: November 2005
|
Ultimate Member |
|
|
I think you should get your Values right....
StrDbl(arrayLineItems.GetColumn(i,2).ToString())
This is really not how we meant it 
In general, GetColumn returns Value and if you have put double into ArrayCtrl or SqlArray, it will return double Value back. So normally above should be something like
(double)arrayLineItems.GetColumn(i,2);
Also
SQL * Select(CUST_ID, CUSTNAME).From(CUSTOMERS);
while (SQL.Fetch())
{
cbCustomers.Add(~SQL[CUST_ID], ~SQL[CUSTNAME]);
}
operator~ in this context converts perfectly good typed Value into String. Probably not something I would do to CUST_ID.
if (txtPrice.GetData().IsNull()) return;
You can just write IsNull(txtPrice). Instead of GetData, consider using operator~ (that in U++ has general meaning something like "other value representation").
arrayLineItems.AddColumn("Description", 80);
....
(DESCRIPTION, arrayLineItems.GetColumn(i,1).ToString())
Sometimes it is worth providing IDs even if you are not directly dealing with SQL, leads to cleaner code
arrayLineItems.AddColumn(DESCRIPTION, "Description", 80);
....
(DESCRIPTION, arrayLineItems.GetColumn(i,DESCRIPTION))
(ToString here is not needed as well as AFAIK it is already String).
SQL * Select(TAXABLE).From(CUSTOMERS).Where(CUST_ID == idNum);
SQL.Fetch();
optCustTaxable.Set(SQL[0]);
As this is pretty common code, there is a shortcut:
optCustTaxable.Set(SQL % Select(TAXABLE).From(CUSTOMERS).Where(CUST_ID == idNum));
Mirek
|
|
|
 |
|
sqlarray and sqlite
By: jimlef on Fri, 18 September 2020 22:49
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Sat, 19 September 2020 05:50
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Sat, 19 September 2020 06:57
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Sat, 19 September 2020 08:04
|
 |
|
Re: sqlarray and sqlite
By: mirek on Mon, 21 September 2020 08:19
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Mon, 21 September 2020 22:54
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Tue, 22 September 2020 03:05
|
 |
|
Re: sqlarray and sqlite
By: mirek on Tue, 22 September 2020 09:08
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Tue, 22 September 2020 17:43
|
 |
|
Re: sqlarray and sqlite
By: mirek on Tue, 22 September 2020 17:54
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Tue, 22 September 2020 18:07
|
 |
|
Re: sqlarray and sqlite
By: mirek on Tue, 22 September 2020 18:47
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Tue, 22 September 2020 20:41
|
 |
|
Re: sqlarray and sqlite
By: mirek on Wed, 23 September 2020 16:32
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Wed, 23 September 2020 17:14
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Wed, 23 September 2020 19:57
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Thu, 24 September 2020 06:08
|
 |
|
Re: sqlarray and sqlite
By: mirek on Thu, 24 September 2020 13:46
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Thu, 24 September 2020 16:40
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Thu, 24 September 2020 19:28
|
 |
|
Re: sqlarray and sqlite
By: mirek on Fri, 02 October 2020 11:40
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Fri, 02 October 2020 15:13
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Sat, 03 October 2020 00:17
|
 |
|
Re: sqlarray and sqlite
By: mirek on Sun, 04 October 2020 10:05
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Sun, 04 October 2020 17:27
|
 |
|
Re: sqlarray and sqlite
By: mirek on Sun, 04 October 2020 19:56
|
 |
|
Re: sqlarray and sqlite
By: jimlef on Sun, 04 October 2020 20:37
|
Goto Forum:
Current Time: Thu Jul 03 03:29:30 CEST 2025
Total time taken to generate the page: 0.02972 seconds
|