like below fixes the issue The foreach will try to cast the control to the specified type which will give that invalid cast exception, what you should do is:
foreach(Control ctrl in this.Controls)
if(ctrl as TextBox != null)
if(ctrl as ComboBox!= null)
Sqlite - Insert gives error - Invalid cast exception - "Invalid cast from 'DateTime' to 'Int32'."
By : user2784221
Date : March 29 2020, 07:55 AM
I wish this helpful for you My guess is you don't have quotes around @dateTimeParam in query, and query parser assumes it is an int. What really bugs me though is why you surround parameters by quotes at all.
var command = new SQLiteCommand (
"INSERT INTO DATAOUT (id, uid, application, eventname, clienttoken, version, datetime, data)" +
" VALUES (@idParam, @userIdParam, @applicationNameParam, @eventNameParam, @clientTokenParam, @versionParam, @dateTimeParam, @dataParam)",
I wish this helpful for you I think your problem is the version itself. Check Mongo is throwing a syntax error due to "$geoIntersects" doesn't exist, it was changed from $intersects to $geoIntersects so I would try to run the same code using:
I wish did fix the issue. I have seen the same issue happened and the latest news I got from support team is: Problem was identified ; due to recently introduced defect some published models were removed ; after which prediction requests against these published models would fail. The original bug was fixed and a repair program was ran that put back the missing published models. So I think your issue should be fixed now as well. If not, please let us know. Thank you. Regards, Yutong