Quote:
quote:Originally posted by xlr8
My code matches the book except some different wording but it doesnt work the same as the one in the download. It only inserts defaults if I click on the cloudy check box. If I just skip over it the program throws an NoNull error.
|
Have you checked the settings for the "Cloudy" field in the "WeatherRecord" table you created? Perhaps you set the field to allow nulls but you treat it in your code as a no null field. Also, did you add the event handler to the DataError event of the DataGridView control? (page 121, step 11).
Good luck! :)
P.S.: Hey I think I found an explanation for your problem. Check page 122 on the problems of null values being created for fields with no value specified once the row is inserted (even though you explicitly set the field to not allow nulls

. That could be a problem espcially with boolean fields (such as "Cloudy" in this particular case)). There you can find a way to fix the issue directly in the data set designer.