DataAdapter with stored procedure.


  • Hi,

    I have created a new data adapter.  This adapter as a stored procedure with the following code like:

    CREATE PROCEDURE spSGCT_SessoesImp (@OPT as varchar(100), @DB as varchar(50) =null)

        if @opt =" TODAS"
           exec('select max (cod_sincronismo_fim), art, setmor from '+@db+'.dbo.sincronismo where tp_processo =''I''
           group by cod_rep_fiscal')    


    When I am configuring the adapter in VB.NET (VS2005) I can define the select, delete , update and insert. In this case I only need the select, because this adapter is to be used in crystal reports.

    As you can see this adapter receives two paramneters.

    Also, When I try save the adapter it says that the object "sincronismo" does not exists. That's normal because I didn't pass the parameter yet.

    When I save it in the select , as told, I can not see it's columns so I can not use it inside the  report.

    What can I do?

    Thank you



    Monday, June 04, 2012 8:53 AM


  • I think it is because of the wizard check if there's a table named "dincronismo", but you point the database instance explicitly, but the name is a variable, so the wizard cannot find an table [object] in the corresponding database instance, since there's no an instance you set in the script, it is designed as a variable.

    I will try to create this kind procedure form the database side.

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, June 06, 2012 8:46 AM