Doubt with Visual Studio and SQL Server

0

Dear,

It turns out that I have a system in visual studio which I wanted to generate a visible query in a datagridview, this gave me error at first, but I realized that as it added a very high amount for an int for it did not work , so I changed the data type to bigint and it worked ... the problem now is in another form which visualizes the data, since there generates another error because in this sumo some columns of a grid, and part of the code says:

.Sum(Function(c) c.Field(Of Integer)("MONTO"))

The problem is that it does not exist, or I can not put c.Field (Of Biginteger) because it does not exist ...

Dim cargoTotal = ddt.AsEnumerable().Where(Function(c) c.Field(Of String)("TIPO") = "BOLETA" Or c.Field(Of String)("TIPO") = "DOCUMENTO DE GARANTIA" Or c.Field(Of String)("TIPO") = "CUPON DE PAGO" Or c.Field(Of String)("TIPO") = "BOLETA ELECTRONICA" Or c.Field(Of String)("TIPO") = "CHEQUE" Or c.Field(Of String)("TIPO") = "FACTURA EXENTA" Or c.Field(Of String)("TIPO") = "BOLETA HONORARIO" Or c.Field(Of String)("TIPO") = "DECRETO ALCALDICIO" Or c.Field(Of String)("TIPO") = "FACTURA" Or c.Field(Of String)("TIPO") = "FACTURA ELECTRONICA" Or c.Field(Of String)("TIPO") = "NOTA DE DEBITO" Or c.Field(Of String)("TIPO") = "RENDICION DE GASTOS" Or c.Field(Of String)("TIPO") = "VALE POR" Or c.Field(Of String)("TIPO") = "OTRO").Sum(Function(c) c.Field(Of Integer)("MONTO"))
    
asked by Diego 25.01.2018 в 13:25
source

1 answer

1

What you should indicate is a type of .NET, not SQL Server.

Try c.Field(Of Long) which would be the equivalent type in .NET.

    
answered by 25.01.2018 в 15:41