Databinding to DetailsView

  • Thread starter Thread starter Matt MacDonald
  • Start date Start date
M

Matt MacDonald

Hi All,
This is hopefully a stupid question.

I have a page with a details view that is bound to an object datasource.
The datasource pulls back a strong-typed datatable from my users database.
The way my app works, a user will not automatically have a username and
password until one is assigned. That being said, when the detailsview binds
to the data, those two fields will be null. Logic would tell me that
wouldn't be a problem, because in other databound controls (gridview for
instance), it just replaces null values with empty strings. For whatever
reason, when I do a details view, I get something to the effect of
"Conversion from type 'DBNull' to type 'String' is not valid." for the
username field when I try to load the page. Any thoughts on how to get past
this would be greatly appreciated.

Thanks,
Matt
 
As an update, I realized that my datasource actually returns a single row,
not a table. Changing this to a table seems to fix the problem, but still
doesn't make much sense.

Thanks,
Matt
 
Matt,

It is a valid AdoNet question, however I give you on this one more chance in
the newsgroup.


Cor
 
Back
Top