This is really simple, create a data entry form for a single table. But it all fails apart because I choose a guid as the ID for the table:
- New WinForms VB.Net project.
- Add a new data source
- Create a table “Notes”
- Add column “ID” as uniqueidentifier, rowid, not null and set as the primary key
- Other columns too; Body, DateCreated etc..
- I use the DataSource Configuration Wizard and my new table is shown.
- Then I drag Details from the Table in the Data Sources treeview onto the form and a nice lot of controls and toolbar appear.
- Execute…
Now when the BindingNavigator tries to add a new record it, the DataSet rejects it. Column ID does not allow nulls. Even if I edit the generated DataSet schema, change it to read only , AllowDBNulls etc.. it has no effect. If I remove the column entirely then the DataAdapter update fails because it needs to know what row to update. The DataColumn.DefaultValue in the schema isn’t smart enough for SQL Server statements like newid() either.
So is there a simple way to make my little test app work
GUID as the primary key (without generating the guid in code)

Data binding, and GUIDs in VB.Net 2005
Rick Sivernell