DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   Regarding the CrystalReport with asp.net (http://www.daniweb.com/forums/thread167463.html)

vimalfor5 Jan 10th, 2009 7:00 am
Regarding the CrystalReport with asp.net
 
Hi all,

i want to create one crystalreport from following storeprocedure

CREATE PROCEDURE dbo.usp_proc1
(
 @ID as int
)

as

declare @Var1 as varchar(1000);
set @Var1 = ' select ID,Name,Email from Demo where ID='+Convert(varchar,@ID)

print @Var1;
exec(@Var1);

This is not the actual code but its a demo of original, i'm using this type of code because i want to join two or more databases with supplied database name like

@dbName+"Connection"

where @dbName is the supplied argument


the problem is when i choose this procedure as the database field for the crystal report the select fields (table columns of the query ) are not displaying

i also tried

CREATE PROCEDURE dbo.usp_proc1
(
 @ID as int
)

as

declare @Var1 as varchar(1000);
set @Var1 = ' select ID,Name,Email from Demo where ID='+Convert(varchar,@ID)

print @Var1;
exec(@Var1);

/* select '' as ID,'' as Name,'' as Email */

still it is not working

i dnt want to create a separate dataset or i dnt want to change the logic of the entire.. !!!
any other suggestions are always welcome
Thanks


All times are GMT -4. The time now is 10:09 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC