cmd.ClearParameter for SQLite.dll

berndgoedecke

Active Member
Licensed User
Hello Erel,
since I have tested the new SQLite.dll, my wish is a new command for the DLL.
It's name should be ClearParameter or something like that.
The background for this wish is the different way for handling DATE- or TIME- values in SQLIte v3.6.3 and in the moment I have no other solution to show SQL-DateTime in a ListView(ControlsExDevice) or Combo-field by using a table, filled with values by the SetParameter command:
If I added a parameter and used it at the first time and set no value to it, because there was no value, SQLite accepted the resulted NULL value and did show a blank field.
If I used this parameter before, for a valid DateTime value, and the next Row had no entry in the same column, the Date from the previous row was shown in the field.
Using of "null" or "" for a column with a DateTime-Value results in an errror:
"No valid DateTime value."
If there is a way to set the Parameter to NULL or to clear it, would this be very nice, because it will solve another problem in the program.

:sign0085:

best regards

berndgoedecke
 

berndgoedecke

Active Member
Licensed User
I did it.

Hello Erel,
I wrote a small sample, you can find attached to this post. I hope it shows the problem clearly. Please note also the remarks in th source and compare the Listview with the Textbox two times by pressing the Button two times.

Best regards


berndgoedecke
 

Erel

Administrator
Staff member
Licensed User
Thank you.
The SQL library will include a cmd.SetNullParameter which will set a parameter to null value.

If you can please download the attached library and see if it solves the problem.

Note that I had some problems with compiling your code. There is an error on line 127 which should be: 'Case Else' instead of 'Else' and also a problem with ControlsExDesktop (maybe you are not using the latest version).
 

Attachments

agraham

Expert
Licensed User
also a problem with ControlsExDesktop (maybe you are not using the latest version).
Probably because berndgoedecke is using ControlsExDevice on the Device and ControlsExDesktop on the desktop.

@ berndgoedecke This won't work for optimised device compilation. ControlsExDeviceDummy (which is actually fully functional except for Notifier) should be used on the desktop for an app that is to be compiled to run on the device. ControlsExDesktop is for desktop only apps that are not intended to run on the device.
 

berndgoedecke

Active Member
Licensed User
It works!

:sign0060::sign0060:

Thank you very much

also for the hints about ControlsEx.dlls. I've mixed some components from my Desktop application(Converter to SQLite) and the Device(Data viewer for SQLite) to write the sample. Excuse my inattention please.


My very best regards

berndgoedecke
 
Top