SqlDataSourceControl + DefaultValue + Null

  • Thread starter Don Quijote de Nicaragua
  • Start date
D

Don Quijote de Nicaragua

Hi, I have a store procedure and try to conect with
SqlDataSourceControl but don't appear nothing.
Any Idea.

Spanish
Estoy tratando de conectarme a un "Store procedure" con un
SqlDataSourceContro pero no me muestra los datos. Alguna idea.

SqlDataSourceControl
<SelectParameters>
<asp:parameter Name="IdCuenta" Type="Int32"
ConvertEmptyStringToNull="true" />
</SelectParameters>

--Store Procedure

ALTER PROCEDURE [dbo].[spINTENTO]
@IdCuenta int -- si deseas todos los paises entonces pasa valor NULL
as
set nocount on;
SELECT IdCuenta, NombreCuenta, CodigoContable, DescripContable, Tipo,
Cnomeclatura, CuentaCredito, CuentaDebito
FROM dbo.tblCuentas WHERE (@IdCuenta IS NULL OR IdCuenta = @IdCuenta) ;
 
D

Don Quijote de Nicaragua

I respond myself

CancelSelectOnNullParameter="false"

Don Quijote de Nicaragua.
 
G

Guest

Hi, I have a store procedure and try to conect with
SqlDataSourceControl but don't appear nothing.
Any Idea.

Spanish
Estoy tratando de conectarme a un "Store procedure" con un
SqlDataSourceContro pero no me muestra los datos. Alguna idea.

SqlDataSourceControl
<SelectParameters>
                <asp:parameter  Name="IdCuenta" Type="Int32"
ConvertEmptyStringToNull="true" />
       </SelectParameters>

--Store Procedure

ALTER PROCEDURE [dbo].[spINTENTO]
@IdCuenta int -- si deseas todos los paises entonces pasa valor NULL
as
set nocount on;
SELECT IdCuenta, NombreCuenta, CodigoContable, DescripContable, Tipo,
Cnomeclatura, CuentaCredito, CuentaDebito
FROM dbo.tblCuentas WHERE (@IdCuenta IS NULL OR IdCuenta = @IdCuenta) ;

What should appear if IdCuenta is NULL and stored procedure returns no
rows? CancelSelectOnNullParameter Property will cancel selection, so
you would not get any data in this case too...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top