problem on stroed procedure

Jul 28 2012 2:42 AM
Hello friends, 
  Below is my store procedure  
       
create procedure [dbo].[temptable] (@branchid int,@academicyearid int)
as

begin
set
nocount on
begin
try
begin
tran
declare
@branchname varchar(50)
declare
@acfy int ;
declare
@acty int
select
@branchname=Branch_name from Branch where Branch_id=@branchid
select
@acfy=Acadamic_year_from,@acty=Acadamic_year_to from Acadamic_year where Acadamic_year_id=@academicyearid
create
table #temptable(Brach_name int,Acadamic_year_from smallint,Acadamic_year_to smallint)
insert
into #temptable(Brach_name,Acadamic_year_from,Acadamic_year_to)values(@branchname,@acfy,@acty)
select
* from #temptable;
commit
end
try
begin
catch
rollback
end
catch
end

exec temptable 141,11
e
my task is i want to bind  branchname and fromyear and to year to my window application form.  is  the procedure right or not? When execution there is no error on this store procedure but when i trace this in dubug mode everything ok.but it doesnt execute line select * from # temptable.i want to return thse three column to my windows form. please help me
 

Answers (1)