SqlDataSourceControl + DefaultValue + Null

Discussion in 'ASP .Net' started by Don Quijote de Nicaragua, Oct 2, 2009.

  1. 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) ;
     
    Don Quijote de Nicaragua, Oct 2, 2009
    #1
    1. Advertising

  2. Re: SqlDataSourceControl + DefaultValue + Null

    I respond myself

    CancelSelectOnNullParameter="false"

    Don Quijote de Nicaragua.


    On 2 oct, 00:40, Don Quijote de Nicaragua <> wrote:
    > 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) ;
     
    Don Quijote de Nicaragua, Oct 2, 2009
    #2
    1. Advertising

  3. Re: SqlDataSourceControl + DefaultValue + Null

    On Oct 2, 8:40 am, Don Quijote de Nicaragua <>
    wrote:
    > 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...
     
    Alexey Smirnov, Oct 2, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dan
    Replies:
    0
    Views:
    544
  2. Replies:
    5
    Views:
    27,261
    Mike Schilling
    Mar 29, 2006
  3. SJL
    Replies:
    2
    Views:
    2,367
  4. =?Utf-8?B?QVNQIERldmVsb3Blcg==?=

    System.ComponentModel.DefaultValue doesn't work with user control

    =?Utf-8?B?QVNQIERldmVsb3Blcg==?=, Sep 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,688
    =?Utf-8?B?QVNQIERldmVsb3Blcg==?=
    Sep 13, 2006
  5. =?Utf-8?B?QW1pcg==?=

    SqlDataSourceControl and AdventureWorks database

    =?Utf-8?B?QW1pcg==?=, Mar 14, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    376
    =?Utf-8?B?QW1pcg==?=
    Mar 14, 2007
Loading...

Share This Page