>I have another .NET issue. I built a DBFUtil object that initializes the SelectCommand, InsertCommand, UpdateCommand, and DeleteCommand objects in a DataAdapter to all use the same VFPOLEDB connection. Everything works fine, and I can SELECT, INSER, UPDATE, and DELETE using a DataTable hooked to a DataGridView.
>
>But when I try to add a new record by entering a new row in the grid, I get NULL errors unless I fill in every field that is being added. There are no constraints on the DBF (it is a free table), and I know new rows are inserted properly if I fill everything in.
>
>I had the same issue with straight SELECT statements, and got around it by issuing a "SET NULL OFF" in the SelectCommand object using ExecuteNonQuery(). For SELECTs, I can have NULLs all over (e.g. when running LEFT JOINS), but if I run the same SET NULL OFF for InsertCommand and UpdateCommand as well, I am still getting NULL errors from the OleDb provider when adding or updating records involving NULLs.
>
>Obviously, I can get around this by making sure I don't have NULLs involved. *smile* But I was wondering if there was another way? Frankly, sometimes NULLs are very useful, as in having a logical field that can be true, false, or simply unanswered. I need to get NULLs working if I can, for creates, reads, updates, and deletes...
I adjusted my framework to populate the proper insert command based on the data dictionnary so all the fields are taking care of. By that, I also avoid any nulls in the table where all fields have a default value. I first tried to adjust the connection strings to tell the VFPOleDb to ignore nulls and things like that but that never worked. I have a InsertRow class that I an instantiating when I need to insert a record, I fill the fields that are only necessary and it does the rest.