I am using the VS.NET designer to access a stored procedure with 3 SELECT
statements. It should only return 2 depending on the input parameter @p1.
When I configure a SqlDataAdapter, I only get only parameter...a
return_value. It ignores the @p1
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "[fn3ExecBriefHome]"
Me.SqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
Me.SqlSelectCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@RETURN_VALUE" ,
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, Nothing))
'
----------------------------------------------
-- HERE IS MY STORED PROCEDURE--
----------------------------------------------
CREATE PROCEDURE
AS
@p1 varchar(5) = 'short'
as
SELECT col1
FROM table 1
If @p1= 'all'
BEGIN
-- Statement 2
SELECT col1
FROM table 1
END
Else
BEGIN
-- Statement 3
SELECT col1
FROM table1
END
--
_____
DC G