Last post Nov 02, 2010 09:48 PM by Lannie
Nov 02, 2010 09:31 AM|mrrogers|LINK
I have a large existing stored procedure who's interface I cannot change that has several parameters of type boolean. ODP.NET doesn't support a boolean type and I get an error when trying to access this proc via .NET using a different data type. Does
anyone have a solution to this?
Nov 02, 2010 09:48 PM|Lannie|LINK
I tried many things for solving the lack of Boolean datatype support in Oracle SQL and ODP.NET.
(Strangely Oracle PL/SQL has a boolean datatype just to irritate everybody)
The easiest and most successful to implement for me was:
Create a data column called TEST that is VARCHAR2(5) and store the case-senstive words 'True' or 'False'
and ASP.NET treats these values as boolean surrogates.
So that this checkbox then works on the string values in both BIND and EVAL scenarios.
<asp:Checkbox ID="cbxTEST" runat="server" Checked='<%# Bind("TEST") %>' Text="Boolean Test" />
<asp:Checkbox ID="cbxTEST2" runat="server" Checked='<%# EVAL("TEST") %>' Text="Boolean Test2" />
Others advocate ASP.NET control overrides, several examples on web.
But I could only get those to work with EVAL, not BIND