I am a beginner of vb2010 + SQLite3, now I have a problem, please ask some experts
I add a DataGridView control to the form, set a column as datagridviewcheckboxcolumn type, and a Boolean field in SQLite3 database, where 0 represents false and 1 represents true. At the same time, the data is called into the dataset, and the data source of the column is set to the field.
The value of the column in the DataGridView control
falseValue=0
Truevalue=1
indeterminatevalue=0
Threestate=false
When the program is debugged, the data can be displayed normally. When the data is 0, the check box is blank. When the data is 1, the check box is checked
You can change the value by clicking the check box of any line with the mouse. However, when you click the check box of other lines, an error occurs. The prompt is as follows:
Exception in DataGridView:
Sytem.FormatE xception:0 Is not a valid value for Boolean.
Sytem.formatexception: the string is not recognized as a valid Boolean value.
In system. Boolean. Parse (string value)
In system. Componentmodel. Boolean converter. Convertfrom (itype descriptorcontext context, cultureinfo, culture, object value)
---The end of the internal exception stack trace---
In system. Componentmodel. Boolean converter. Convertfrom (itype descriptorcontext context, cultureinfo, culture, object value)
In system. Windows. Forms. DataGridView. Datagridviewdataconnection. Pushvalue (int32 boundcolumnindex, int32 columnindex, int32 rowindex, object value)
To replace this default dialog box, handle the dataerror event.
I searched the Internet and said that the value was not converted (because SQLite3 database uses 0 and 1 to represent false and true), so there was an error. Ask a master, how to change? In which event is the transformation better (with specific code)? One is 0, one is true, and the other is false. It's dizzy for a beginner
I add a DataGridView control to the form, set a column as datagridviewcheckboxcolumn type, and a Boolean field in SQLite3 database, where 0 represents false and 1 represents true. At the same time, the data is called into the dataset, and the data source of the column is set to the field.
The value of the column in the DataGridView control
falseValue=0
Truevalue=1
indeterminatevalue=0
Threestate=false
When the program is debugged, the data can be displayed normally. When the data is 0, the check box is blank. When the data is 1, the check box is checked
You can change the value by clicking the check box of any line with the mouse. However, when you click the check box of other lines, an error occurs. The prompt is as follows:
Exception in DataGridView:
Sytem.FormatE xception:0 Is not a valid value for Boolean.
Sytem.formatexception: the string is not recognized as a valid Boolean value.
In system. Boolean. Parse (string value)
In system. Componentmodel. Boolean converter. Convertfrom (itype descriptorcontext context, cultureinfo, culture, object value)
---The end of the internal exception stack trace---
In system. Componentmodel. Boolean converter. Convertfrom (itype descriptorcontext context, cultureinfo, culture, object value)
In system. Windows. Forms. DataGridView. Datagridviewdataconnection. Pushvalue (int32 boundcolumnindex, int32 columnindex, int32 rowindex, object value)
To replace this default dialog box, handle the dataerror event.
I searched the Internet and said that the value was not converted (because SQLite3 database uses 0 and 1 to represent false and true), so there was an error. Ask a master, how to change? In which event is the transformation better (with specific code)? One is 0, one is true, and the other is false. It's dizzy for a beginner