0. Welcome to (C#) programming.
1. Your piecemeal reporting makes it very difficult to get an overall picture of what is going on, I had to copy each of your messages into a single file to understand and check it somewhat...
2. MessageBoxes aren't very good for debugging, I much prefer logging (to a file).
You can read about it here: Article: A simple logging scheme[^] .
When you write an Exception.ToString() result to a file, you can look at it at your leasure; and you can copy and paste all or parts of it here.
3. From Google "0x80040e10":
OleDbException (0x80040e10): No value given for one or more required parameters.
4. Some databases know about booleans, and allow them to have either two (true/false) or three (true/false/unknown) values. This is a probable cause for problems.
My guess: it would probably be very wise to tell your database what default value you want (either true or false, not unknown/null).
This may be sufficient for your code to start working (I mean without exception, not necessarily correctly).
You are probably right that a boolean is the culprit, and your current attempt uses five boolean fields; fixing one won't help a bit. If something is wrong with one of them, the same probably applies to all of them. Hence my urgent advice:
- create a small table with only one number and one bool;
- use it to get successful INSERT and UPDATE operations, so you find out how to do that;
- only then attempt your complex table with real fields and data.
In general: try walking before running.
6. your subject line refers to the update query, however your messages seem to discuss inserts all the time??
7. IMO you need an explicit three-line approach, something like:
OleDbParameter parameter = new OleDbParameter("@r", OleDbType.Boolean);
parameter.Value = myCheckBox.Checked;
modified 23-Jul-19 14:13pm.
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.