Ryanls

Hello

I have a project in VS 2005, VB.net and .NET CF. I have one particular form with controls that are bound to a stronly typed dataset.

In the Load event of the form, there are 4 tableadapters that fill. The first 3 fill fine. The last one throws a NoNullAllowedException, telling me Column ColumnName does not allow Null. All of the columns in the datatable are set to allow nulls.

I am not sure how to solve this problem. I even set that particular field in code to AllowDBNull

Please help. I have worked on this one for 3 days. Has anyone run into this problem



Re: Smart Devices General problem with null errors

Ilya Tumanov

I¡¯m fairly confident your assumption about ¡°all of the columns in the data table allow nulls¡± is wrong. Should it be true exception won¡¯t be thrown in a first place, right Besides, any properly designed database must have a primary key which is unique and none-null. So make sure to take some time to understand your data table/data base schema.






Re: Smart Devices General problem with null errors

Ryanls

Thank you for responding.

My database tables all have primary keys which are unique and none-nulls. The rest of the columns are nullable.

I dont understand what you mean by "Should it be true exception wont be thrown in a first place"

I cant trace where the exception is getting thrown but the error message does give me a specific column. I set that column to allow null and it still throws the error.

I appreciate your help.





Re: Smart Devices General problem with null errors

Ilya Tumanov

What I¡¯m saying is: since it complains about null values that means you did not really set it to allow nulls.

May be you have not updated DataSet¡¯s schema or perhaps you¡¯ve changed a wrong file but it¡¯s configured not to allow nulls.






Re: Smart Devices General problem with null errors

Ryanls

Thank you very much for your help. I was able to narrow down the spot in the code that was throwing the exception. It was one of my look up table fill statements. I studied the dataset closer and discovered that the column it was complaining about was in fact configured to not allow nulls.

Learn somthing new everyday, right

Again, thanks for your help.