views:

65

answers:

1

Hi,

I just upgraded my project to ASP.net MVC RC. The bad thing is HTML helpers are throwing exceptions from the dataset even when I pass a new datarow. Error is as a result of conversion to dbnull from .net object types.

This exceptions occurs on my UI. I do check for DBnull on update but not when binding. MVC beta wasn't behaving as such and I think it's good. Frameworks shouldn't throw exceptions on retrieving dbnull values from datasource...

Is there a solution to this problem?

A: 
  1. Convert the values in your dataset to a view model, a collection of objects of a class with strongly-typed, named properties corresponding to your columns, that contains null values instead of DBNull. Pass this model to your view.

  2. Report the problem at www.codeplex.com as an issue. Note you may need to create a free login before you can submit an issue.

tvanfosson
datatables doesnt support nullable object...doing this for all > 20 tables would be reengineering...i'll rather use Entity frameworks if that is the case...my question is, why with MVC RC?