ASP.NET - error sqlDataReader

 
Vista:

error sqlDataReader

Publicado por lola (19 intervenciones) el 09/10/2006 20:19:48
Tengo esta linea de condigo

SqlDataReader myReader = myCommand.ExecuteReader();

y me da el siguiente error

Line 1: Incorrect syntax near '='.
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 '='.

alguien me puede ayudar
muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 56
Bronce
Ha mantenido su posición en ASP.NET (en relación al último mes)
Gráfica de ASP.NET

RE:error sqlDataReader

Publicado por Yamil Bracho (1136 intervenciones) el 10/10/2006 15:39:14
Lo que te esta indicando es que debes encerrar esas lineas en un bloque try.. catch. Asi

try
{
....
SqlDataReader myReader = myCommand.ExecuteReader()
}
catch (Exception ex )
{
Console.WriteLine( ex.StackTrace );
}

Por supuesto abriste la conexion, se la asiganste al comand, etc, no ?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar