TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
RobertoCarlos Melgar
1.6k
159
10.2k
Convert object type
Jul 18 2020 2:31 PM
Hello good afternoon to everyone. could you please help me with the following
I would like to bring to a datagridvew the corresponding sales between two date ranges
for this I have the following code
namespace
CapaLogica
{
public
class
VentasEntreFechasDTO
{
public
string
NumeroVenta {
get
;
set
; }
public
string
Producto {
get
;
set
; }
public
string
Unidad {
get
;
set
; }
public
decimal
Precio {
get
;
set
; }
public
int
Cantidad {
get
;
set
; }
public
decimal
ValorFila {
get
;
set
; }
//
public
static
List<VentasEntreFechasDTO> Ventas(DateTime Inicio, DateTime Fin)
{
using
(GourmetEntities db =
new
GourmetEntities())
{
var li = db.tblMaestroVentas.Include(x => x.tblDetalleVentas).Where(x => x.FechaVenta >= Inicio && x.FechaVenta <= Fin);
return
(List<VentasEntreFechasDTO>)li;
}
}
}
}
this code apparently doesn't show me any error, but when I try to load it to a datagridview it shows me an error
private
void
BtnBuscar_Click(
object
sender, EventArgs e)
{
if
(VerificarRangoFechas())
{
DataGridViewVentaEntreFechas.DataSource = VentasEntreFechasDTO.Ventas(DtpDesde.Value.Date, DtpHasta.Value.Date);
}
}
Please how can I solve this error since I need to visualize sales between date ranges
please help
Roberto Melgar
Reply
Answers (
1
)
Can we host .net WebAPI in WAS?
Convert this to linq