I made a stored procedure but it will not return a value to my method. I have spent way too long looking at this code so any help would be appreciated:
ALTER PROCEDURE
@Table
@Field
@Record
@Returned
AS
Declare
SELECT
Exec
The procedure does exactly what I want and it runs fine when I use the SQL Executor in VS08, but it doesn't seem to be returning a value. Here is my method.
public
{
cmd.CommandType = System.Data.
cmd.CommandText =
cmd.Connection = sqlConnection1;
sqlConnection1.Open();
cmd.Parameters.Add(
cmd.Parameters[
cmd.ExecuteReader();
returnValue = cmd.Parameters[
sqlConnection1.Close();
}
The output is being sent to a Form in my application. Just getting it to run took me a long time, but now no values return. I am also not clear on when to Open and Close the connection, maybe that's the problem? I tried moving that code around to no avail. Also, when I take my method arguments do this need to be explicitly converted to varchars? I am just lost..