using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using EntitiesLayer; namespace DataLayer { public class D_Dashboard { readonly SqlConnection connect = new SqlConnection(ConfigurationManager.ConnectionStrings["SistDB"].ConnectionString); SqlCommand command; SqlDataReader dataReader; public void PreferedClients(E_Dashboard entityObject) { command = new SqlCommand("SPClientes_Preferidos", connect) { CommandType = CommandType.StoredProcedure }; connect.Open(); dataReader = command.ExecuteReader(); while (dataReader.Read()) { entityObject.Profesionales.Add(dataReader.GetString(0)); entityObject.CantFacturado.Add(dataReader.GetInt32(1)); //Here is where the error pops up } dataReader.Close(); connect.Close(); } } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace EntitiesLayer { public class E_Dashboard { public ArrayList Profesionales { get; set; } = new ArrayList(); public ArrayList CantClientes { get; set; } = new ArrayList(); public ArrayList Clientes { get; set; } = new ArrayList(); public Arraylist CantFacturado { get; set; } = new ArrayList(); public static decimal TOTALVENTASDIA { get; set; } public int TotalClientes { get; set; } public int TotalProfesionales { get; set; } } }
ArrayList
List<T>
public Arraylist CantFacturado { get; set; } = new ArrayList();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)