Uğur UMUTLUOĞLU
Web Technologies, Microsoft and .NET Technologies

"You tried to assign the Null value to a variable..." Error and Solution

Tuesday, 6 January 2009 12:44 by ugur
When you use a table formed in MS Access with AccessDataSource control in Insert processes, you might come across an error like "You tried to assign the Null value to a variable that is not a Variant data type". Even if there is not a null value in your query, this error will occur because the identity column of your table has been added to the Insert statement in Visual Studio as the data input column. The solution is actually very simple, you should remove the name and parameter (the ? character in Value region) of identity column (is usually primary key column) from InsertCommand property of AccessDataSource control in HTML codes. At last, you can successfully execute Insert comment after you have removed the parameter added for identity column in InsertParameters collection.
Tags:   ,
Categories:   ASP.NET
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed
 
Add to Technorati Favorites