ConvertEmptyStringToNull Property

A) public void GetEmployee (int EmployeeID);

<asp:ObjectDataSource  SelectMethod="GetEmployee" …>
  <SelectParameters>
    <asp:ControlParameter Name = "EmployeeID" ...>
  </SelectParameters>


If for some reason the EmployeeID parameter is NULL, ObjectDataSource will convert Null to zero and pass it as an argument to the GetEmployee () Method.

Why does the runtime make such a conversion? Wouldn't throwing an exception make more sense?

B) "Use the ConvertEmptyStringToNull property to indicate that an empty string value is automatically converted to null when the data field is updated in the data source."

I do not quite understand the usefulness of this property. Why would an empty string indicate that we want zero to be inserted into the data field sources? Id Suppose this data field is of type String? then why not ConvertZeroInt32ToNull etc.?

bye

+3
1

A) , ODS null T. int 0.

B) HTML . emptry ODS Convert Empty to Null true, null. ConvertZeroToNull, HTML Windows .

+5

Source: https://habr.com/ru/post/1705139/


All Articles