Questions tagged as 'c#'

1
answer

Implementation of Identity in existing project - Not working

I have a project for a virtual store. The store already exists today in ASP and I'm migrating to .NET. I have the intention of using the authentication control of the .net itself, however when I started the project, I started a blank (without au...
asked by 26.02.2016 / 14:26
2
answers

Search text file and compare with others

I have two string lists. Received and Fixed. Well, I would like with just a lambda expression, I go through the Recebido list within the Fixo list and if there is no file within Fixo , I save those files that do not exist in...
asked by 28.02.2016 / 18:58
3
answers

How to get the amount of "true"?

Follow the code below: int total_true = ctx .MinhaTabela .Where(x => x.id == 5) .Select(x => new Tabela_DTO { Campo1 = x.Campo1, // database está como true Campo2 = x.Campo2, //database está como false...
asked by 31.07.2018 / 19:47
1
answer

Find the largest number in a text file

I'm trying to make a program that reads a text file and tell me the largest number in it. Here's what I already have from the code: while (sLine != null) { sLine = objReader.ReadLine(); if (sLine != null) arrText.Add(sLine);...
asked by 03.07.2018 / 15:17
2
answers

Configuration file for C # forms Winforms

Is there any way to create a file where I can set eg a color with the name 'Background' and add the value '#fff', then use it in all my forms, similar to a CSS style, so in case I need to change this color I do not need to change in all the form...
asked by 02.07.2018 / 04:50
3
answers

Decimal problems in SQL string

I'm having an error: every time the variable c.Value_value passes the SQL string, automatically, the "." which separates the Decimal is converted to ",". Asyoucanseeinthisimage,thevariableisusingthe"." usually. However,theSQLstringtakest...
asked by 05.07.2018 / 16:34
2
answers

How to do an if-type validation in a set of options?

I need to make a if where I check a set of options to not make a if inside another if to check if a field is filled or not, I want to do it with a single if . Ex if(valr1, valor2, valor3 != "") Follow the cod...
asked by 29.07.2018 / 15:43
1
answer

How to work with several parameters in C #

Good afternoon. I need a help, I have a combobox with 3 options, and I need to pass any of the three options as a parameter of a procedure in sql for a query, but as I am new to C # I have never passed more than one parameter to a query in sql s...
asked by 26.07.2018 / 17:25
3
answers

How do I know if one string contains another? [duplicate]

I have List<string> with four items: C:\Users\Producao\OneDrive\VisualStudio2017\siteRelatorios\bpa\Content\Upload\LFCES004.txtb9109712-d3f2-4151-bbac-7fbc82ed99de C:\Users\Producao\OneDrive\VisualStudio2017\siteRelatorios\bpa\C...
asked by 09.08.2017 / 20:32
1
answer

I have a panel in aspx, but it gives error in the code behind (Web Form)

I have a project in aspx to maintain and I have this in the aspx page <asp:Panel ID="painelTeste" runat="server"> and in the code behind gives error    The panelTest name does not exist in the current context. What shou...
asked by 28.12.2018 / 15:49