How to prevent blank string from becoming DBNull.Value when DGV is bound to DataTable
问题 Hard to post code, but easy to describe how to repro: Create a new Winforms project (I used VS 2017 and .NET 4.7) Add a DataSet to the project. Within the DataSet, add a DataTable (no adapter). Within the DataTable, add a single column. It will default to varchar, but change it to NOT allow nulls. Add a Form to the project. Add a DataGridView to the form. Set the DataSource for the DGV to the DataTable in the DataSet. Run the program. Click in the single column of the single row. Type some