Colegas
estoy trantando de leer un Store Procedure en un DataRead , pero cuando lo
hago sin parámetros funciona pero con parámetro me da error
Me pueden decir por que??
*********************************************************************
//Define los objetos de ADO.NET
SqlConnection miConexion = new SqlConnection(strConexion);
SqlCommand miComando = new SqlCommand("sp_ListaPersonal",miConexion);
SqlParameter miParametro = miComando.Parameters.Add("@TipoOficina",
SqlDbType.VarChar, 12);
miParametro.Value = "TODAS";
SqlDataReader miReader ;
// abre la base de datos y obtiene la información
miConexion.Open();
miReader= miComando.ExecuteReader();
// en la líena del ExecuteReader() me da el siguiente error:
******************************
Line 1: Incorrect syntax near 'sp_ListaPersonal'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect
syntax near 'sp_ListaPersonal'.
*****************************************
Alguna idea...
Gracias a todos
Leer las respuestas