For small applications it is proper to use AccessDataSource object in order to access the database directly from asp.net page. When i first used it for inserting data with formview, it generated the following error :
"You tried to assign the Null value to a variable that is not a Variant data type"
today i tried the same thing again and it generated the same error again.
I found out that in the generated mark up, although id field is of type autonumber and primary key, visual studio generates a parameter for that field in the markup of the aspx page. I deleted those parameters from the insert command of AccessDataSource and FormViews Insert and Edit Item templates. Then it worked as it should. I think that is a bug of visual studio ide.
serkan sendur 821 Postaholic Banned Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.