I have a strongly typed DataTable created with the VS2005/VS2008 DataSet designer.
The table has a Primary Key column that is a guid, which gets populated by SQL server. The problem is when I want add a row (or multiple rows) to my DataTable and then call the DataAdapter.Update method (passing in the DataTable). When DataAdapter.Update is called I get a SQL exception saying that I cannot insert NULL into the primary key column.
我该如何告诉设计师这是一个自动生成的列,我不想为新行提供值?我只想让 SQL 生成值。
Am I missing something here, or is this a limitation of the DataSet designer?
我知道如何使用LINQ to SQL实现这一点,但不幸的是,这个项目我没有它可用。