Hello,
I am messing up somewhere when writing a function to execute stored procedure. I think i don't have an idea how to execute SqlHelper.ExecuteReader. in SQL server 2005
This should return the state name. But i get it empty. Any idea, why??
Thanks in advance :)
reader = SqlHelper.ExecuteReader(DbConnString, System.Data.CommandType.StoredProcedure, "GetStateName", parameters);
while (reader.Read())
StateName = reader["StateName"].ToString();
return StateName;
and the stored proc:
Create PROCEDURE [dbo].[GetStateName](
@StateInitials varchar
)
AS
Begin
SELECT StateName FROM StateList WHERE StateInitials=@StateInitials
End