Questions tagged as 'c#'

3
answers

Make a code that brings values like this (1K, 1M or 2G)

My rule is: If a value is in the thousands, I should put it like this:    1564 = 1K       345.786 = 345K       2345 = 2K The same goes for the millions and so on. Well, the question is how to get only the values before the first point a...
asked by 18.01.2018 / 18:41
2
answers

Preventing Data Resend When Updating Page (F5) in ASP.NET

Well, I have the following problem: I have a web application made with ASP.NET and C #. In this application I have a simple system for registering items. After I register an item in the application, if I have the browser page refreshed...
asked by 26.03.2014 / 19:40
3
answers

Fill string with zeros [duplicate]

How to check and fill a string if its size is less than a condition? For example, I always need to have a string size of 8 or 9. If the string is larger I give a substring by taking only the first 9 characters. If it is smaller, I need to fill...
asked by 12.04.2018 / 16:41
3
answers

WebService in javascript

How to consume a Web Service by javascript using Visual Studio? I've searched and found a way to do it with Jquery but I've never used it before. I need to consume this Web Service to search for information such as Addresses etc. I already...
asked by 12.02.2014 / 13:41
5
answers

Contains in Class List

I have my class, which has 2 classes inside it. public class ProfEsp { public Especilidade Especialidade {get;set;} public Profissional Profissional {get;set;} } public class Especialidade { public int Id {get;set;} public string Nome {get;se...
asked by 22.05.2014 / 19:46
2
answers

Adding CSS to the Grid Registry

I'm trying to add a bold to a record in the grid, but it appears as " <b>Nome</b> " and not " Name " as it should. I'mdoingthisforcodebehind,throughLINQHere'smyViewUltimateShort()method:privatevoidexibirUltimoSorteio(){varapo...
asked by 27.11.2014 / 18:24
3
answers

Does complex code interfere with application performance?

I have a legacy C # web application that works on my client, but it's been around for 3 years now. At the time, I programmed how I learned in college and did not know the concept of clean code. It's not that big, but it's very complex, and I...
asked by 14.08.2014 / 17:27
3
answers

Problems with logic (&& or ||)

I found the code that is in my system strange: if (cmbCdTipoProcesso.SelectedValue != "3" && cmbCdTipoProcesso.SelectedValue != "4") {....} Apparently the code is strange because I will never have cmbCdTipoProcesso.SelectedVa...
asked by 07.01.2015 / 13:00
4
answers

SELECT within UPDATE

I have the following database: cd_telefone|cd_cliente |nr_ddd |nr_telefone 1 | 30 | 11 |2562-2791 2 | 30 | 11 |2562-2791 3 | 31 | 13 |8888-8888 4 | 30...
asked by 27.11.2014 / 19:08
3
answers

Error comparing numbers and checking if they are the same

I'm doing a simple C # exercise in which I have to get two numbers, compare them and print which one is the greatest or are the same. When I start the program, I can only put the first number, and before placing the second, the program alread...
asked by 21.06.2016 / 18:15