Mi problema es el siguiente:
Genere un Stored Procedure en sql 2000 que recibe solo un valor para hacer la consulta (@Valor)
create Procedure ScriptProcedure (@Valor varchar (9))
as
select FOLIO.[Id_Folio],FOLIO.[Fecha],FOLIO.[Hora],(PERSONA.[Nombre]+' '+PERSONA.[Apaterno]+' ' +PERSONA.[Amaterno]) as 'Nombre', PETICIONES.[Id_Peticion],PETICIONES.[Descripcion],PETICIONES.[Status] from FOLIO, PERSONA, PETICIONES where FOLIO.[Id_Folio]=@Valor and FOLIO.[Id_Folio]=PETICIONES.[Id_Folio] and PERSONA.[Id_Persona]=FOLIO.[Id_Persona]
En una página aspx recibo una valor por la URL que
String FolioDocumento;
FolioDocumento = Request.QueryString[
"n"];
Mi problema es que quiero generar un Reporte en Crystal Reports basandome en el stored procedure y no se como hacer que mediante programación se pueda mandar un valor a la variable del store procedure.
Genere el siguiente código en c#.net pero no me devuelve ni un resultado:
conexion =
new SqlConnection("server=ANGEL;database=Micronext;uid=sa;pwd=");
conexion.Open();
DataSet userDataset = new DataSet();
SqlDataAdapter myCommand = new SqlDataAdapter("ScriptProcedure", conexion);
myCommand.SelectCommand.CommandType =
CommandType.StoredProcedure;
myCommand.SelectCommand.Parameters.Add(
"@Valor", SqlDbType.VarChar, 9);
myCommand.SelectCommand.Parameters[
"@Valor"].Value = FolioDocumentor;
myCommand.Fill(userDataset);
conexion.Close();
Solo me devuelve la página donde esta el CrystalReportViewer1: "Faltan valores de parámetro."
Espero que me puedan ayudar...