hola a todos, miren tengo este codigo:
Bueno de seguro quieren ver q hay en la clase ClienteD exactamente en ListarClientes()
Código C# - Clase:
Ver originalpublic List<clienteE> ListarClientes()
{
SqlConnection conexion = new SqlConnection(conexionD.Instancia.Cadenaconexion());
try
{
conexion.Open();
SqlCommand consultasql = new SqlCommand("procCliente", conexion);
//Especificamos que le estamos un parametro del tipo SP
consultasql.CommandType = System.Data.CommandType.StoredProcedure;
//la operacion que queramos //dentro del SP //1=Select
consultasql.Parameters.Add("[arroba]Tipoconsulta", System.Data.SqlDbType.TinyInt).Value = 1;
SqlDataReader Reader = consultasql.ExecuteReader();
List<clienteE> Coleccion = new List<clienteE>();
while (Reader.Read())
{
Coleccion.Add(new clienteE(Reader.GetString(0), Reader.GetString(1), Reader.GetString(2), Reader.GetString(3), Reader.GetString(4), Reader.GetString(5), Reader.GetString(6), Reader.GetString(7), Reader.GetString(8)));
}
return Coleccion;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
conexion.Close();
conexion.Dispose();
}
}
Bueno el error q me sale es: "El índice estaba fuera del intervalo. Debe ser un valor no negativo e inferior al tamaño de la colección.
Nombre del parámetro: index"
ehhh alguna ayudadita me vendria muy bien muchachos, gracias de antemano...
Salu2...