Hi, i've been playing around with the formview today and have come into a few problems. My latest problem is handling nulls from the database. For example in my code i have a textbox:
<asp:TextBox ID="txtDescription" Text='<%# Bind("Description") %>' runat="server"></asp:TextBox>
The Description field in the database allows null values. When i try to edit a record that has a null value an exception is thrown.
I understand i can use the textbox on databinding event to convert the data to an empty string if the value is null but i have so many fields that allow nulls and this seems abit of a long winded way of doing it so i was wondering if there was a better way.
Appreciate if someone could help. Thanks
<asp:TextBox ID="txtDescription" Text='<%# Bind("Description") %>' runat="server"></asp:TextBox>
The Description field in the database allows null values. When i try to edit a record that has a null value an exception is thrown.
I understand i can use the textbox on databinding event to convert the data to an empty string if the value is null but i have so many fields that allow nulls and this seems abit of a long winded way of doing it so i was wondering if there was a better way.
Appreciate if someone could help. Thanks