Questions tagged as 'c#'

1
answer

Calculation of currency sum

I need some help to make a calculation in fact a sum for money, as I show in the image below: Followmycode.privatevoidListaGrid(){conex.Open();stringstrSQL=@"SELECT DISTINCT SY.YF_DESC_SI...
asked by 23.08.2017 / 18:39
1
answer

In savechages says column is null and has value

When I call my method to write, the whole object comes filled, but when the savechanges () is called it says IdBalance is null and yet it has the value of 1. Insert method: public virtual void Inserir(T item) { contexto.Se...
asked by 17.08.2017 / 17:02
1
answer

Mapping 1 to 0, 0 to 1

I need to create a mapping between two existing entities, where both are independent. Then. I have one DepositoTransferencia entity and the other one is Conta . The idea is that at a given moment, the DepositoTransferencia en...
asked by 10.08.2017 / 14:41
1
answer

Upload list with entity

The following. I created a context class inherited from DbContext . public class SiloContext : DbContext { public SiloContext() : base("inetConn") { } public DbSet<Produto> Produtos...
asked by 11.08.2017 / 16:53
1
answer

Convert float, double, or single value to DateTime

I was having Cast problems when I was running a lambda and serializing to the service. Well, the solution was to pass everything to String and I did it. On the other side (Android App) I get and do what has to be done. Well, it turns out that...
asked by 05.09.2017 / 16:05
1
answer

Difficulty with listview layout in xamarin.forms

See this image Mylayoutisbroken.Youcanseethatthecustomernameis:SebastiaoLoureirodeAlmeidaandinthelistviewSebastiaoappearsandtherestofthenameappearsbelow,appearingonlythe" of the name "iceberg". My difficulty is in increasing the cell size or...
asked by 05.09.2017 / 11:47
1
answer

If you do not have the value to compare, save without making the comparison

I'm trying to make my application save if it has no value to compare, but it's always going through the comparison, I've already tried to put an if but it still has a problem, this is the class that compares my view to my database. Controller...
asked by 05.09.2017 / 17:12
2
answers

Save the date and time?

I wanted to know how to save the date and time in the database, and the time wanted to be automatically pulled from the machine or server. So I was able to log the date, but the time is cleared. MyViewModel:publicintId{get;set;}publicdecimal...
asked by 05.09.2017 / 22:35
1
answer

Force a SqlDataReader result

I have the following method: public ClassCardapio MontaCardapioEdit(string periodo, int tipo) { ClassCardapio cardapio = new ClassCardapio(_stringconexao); _conexao.Open(); var sql = $"SELECT " +...
asked by 04.08.2017 / 14:17
1
answer

How to handle the error Object reference not set to an instance of an object

Create 2 new columns in my table dbo.FormaPgto - FPNFCeCpnjCred and FPBandeira both Allow Null When I go to a form of payment, it gives the following error in the fields: txtFPCnpj.Text = objFPagto.FPNFCeCpnjCre...
asked by 02.08.2017 / 22:04