Hi there,
I have a problem filling a DataSet. Here are the background:
I'm executing a SP that retrieve some data, about (26 records). Those records have 3 string columns.
When I fill the DataSet with this results, there is no problem, I can fill a DataGrid a display it in the aspx. But in other execution, the SP return more data, the DataSet isn't filled, namely, the DataSet is empty. The Query is OK.
I have been tried some things. I have changed the wide of the columns with SUBSTR function and temporaly I resolve the problem. But I need display all the content of the columns. I have been played with the wide of these 3 columns and results are mixed, sometimes works, sometimes don't.
This is a fragment code of the Store Procedure
This is my C# code
This is the DataSet XML code:
The problem is with the number of characters returned in the string columns, but I think isn't normal, because I'm working with columns(varchar2) that have 255 character max
Any idea??
________________________________
Juan Carlos Silva
Software Developer
I have a problem filling a DataSet. Here are the background:
I'm executing a SP that retrieve some data, about (26 records). Those records have 3 string columns.
When I fill the DataSet with this results, there is no problem, I can fill a DataGrid a display it in the aspx. But in other execution, the SP return more data, the DataSet isn't filled, namely, the DataSet is empty. The Query is OK.
I have been tried some things. I have changed the wide of the columns with SUBSTR function and temporaly I resolve the problem. But I need display all the content of the columns. I have been played with the wide of these 3 columns and results are mixed, sometimes works, sometimes don't.
This is a fragment code of the Store Procedure
Code:
....
SELECT CTR_CONTRATO.con_numcontrato con_numcontrato, SUBSTR(CTR_CONTRATO.con_descripcion, 0, 50) con_descripcion, SUBSTR(CTR_CONTRATO.con_compania, 0, 20) con_compania, SUBSTR(CTR_CONTRATO.con_observacion, 0, 55) con_observacion,
....
This is my C# code
Code:
OracleCommand oOracleCmd;
oOracleCmd = new OracleCommand();
oOracleCmd.Connection = oOracleConx;
oOracleCmd.CommandText = "PKG_CONTRATOS.sp_rep_contratos";
oOracleCmd.CommandType = CommandType.StoredProcedure;
oOracleCmd.Parameters.Add(new OracleParameter("IO_CURSOR", OracleType.Cursor)).Direction = ParameterDirection.Output;
oOracleCmd.Parameters.Add(new OracleParameter("pSQL", OracleType.VarChar, 10000)).Direction = ParameterDirection.Output;
OracleDataAdapter oOracleAdapter = new OracleDataAdapter(oOracleCmd);
DataSet ods = new dsRepctr(); // DataSet
oOracleAdapter.Fill(ods,"CTR_CONTRATO");
dgTemp.DataSource = ods;
dgTemp.DataBind();
.....
.....
This is the DataSet XML code:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="dsRepctr" targetNamespace="[URL unfurl="true"]http://tempuri.org/dsRepctr.xsd"[/URL] elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="[URL unfurl="true"]http://tempuri.org/dsRepctr.xsd"[/URL] xmlns:mstns="[URL unfurl="true"]http://tempuri.org/dsRepctr.xsd"[/URL] xmlns:xs="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="dsRepctr" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="CTR_CONTRATO">
<xs:complexType>
<xs:sequence>
<xs:element name="CON_NUMCONTRATO" type="xs:string" />
<xs:element name="CON_DESCRIPCION" type="xs:string" minOccurs="0" />
<xs:element name="CON_COMPANIA" type="xs:string" minOccurs="0" />
<xs:element name="CON_OBSERVACION" type="xs:string" minOccurs="0" />
<xs:element name="CON_MONTOPESOS" type="xs:decimal" minOccurs="0" />
<xs:element name="CON_MONTODOLAR" type="xs:decimal" minOccurs="0" />
<xs:element name="CON_IDCOMPANIA" type="xs:int" minOccurs="0" />
<xs:element name="CON_IDCON" type="xs:int" minOccurs="0" />
<xs:element name="FECHA_AMP" type="xs:date" minOccurs="0" />
<xs:element name="MONTO_AMP_PESOS" type="xs:decimal" minOccurs="0" />
<xs:element name="MONTO_AMP_DOLAR" type="xs:decimal" minOccurs="0" />
<xs:element name="ACUOBRAS_PESOS" type="xs:decimal" minOccurs="0" />
<xs:element name="ACUOBRAS_DOLLAR" type="xs:decimal" minOccurs="0" />
<xs:element name="SUMMTOADIPESOS" type="xs:decimal" minOccurs="0" />
<xs:element name="SUMMTOADIDOLAR" type="xs:decimal" minOccurs="0" />
<xs:element name="SALDOPESOS" type="xs:decimal" minOccurs="0" />
<xs:element name="SALDODOLAR" type="xs:decimal" minOccurs="0" />
<xs:element name="INICIO" type="xs:string" minOccurs="0" />
<xs:element name="FIN" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
The problem is with the number of characters returned in the string columns, but I think isn't normal, because I'm working with columns(varchar2) that have 255 character max
Any idea??
________________________________
Juan Carlos Silva
Software Developer