You receive a "Column 'Column Name' does not allow nulls" message when you add a record or when you move through records in a database by using a data form (833902)
The information in this article applies to:
- Microsoft Visual Studio 2005 Professional Edition
- Microsoft Visual Studio 2005 Standard Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSIn a Microsoft Windows application, if you use a data form to add a new record to a database, you may receive the following message:
Column ' Column Name' does
not allow nulls. Note Column Name is a placeholder for the
name of the column of a table in the database where the primary key constraint
exists. If you use the navigation buttons to move through the records of a database table on the data
form, you may receive the following error message: An
unhandled exception of type 'System.Data.NoNullAllowedException' occurred in
system.data.dll Additional information: Column 'Column
Name' does not allow nulls. CAUSEThis behavior occurs because the primary key or the not NULL column of the database
table was not selected in the Data Form Wizard. If the primary key or the not NULL column of the database
table is not selected in the Data Form Wizard when you create the data form, the Add
- Creates a new record option is not disabled.WORKAROUNDTo work around this problem, select the following columns of the selected table when you
add a data form by using the Data Form Wizard:
- The primary column
- A column that does not permit NULLS
STATUS This
behavior is by design.REFERENCESFor more information about the Data
Form Wizard, visit the following Microsoft
Developer Network (MSDN) Web site:
Modification Type: | Major | Last Reviewed: | 2/28/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kberrmsg kbDatabase kbWindowsForms kbprb KB833902 kbAudDeveloper |
---|
|