Most voted ".net" questions
The Microsoft . NET is a set of libraries and functions that are part of the Basic Class Library (BCL), such as user interface functions, data access, connectivity, cryptography, web development, mathematical algorithms, and network communication.
Learn more…2,689 questions
Sort by count of
-
-2
votes1
answer462
viewsHow to cache c# . NET information for multiple users?
I have a list of objects, and I would like each user who accesses a page, to add their objects to the cache. And that this cache was worth to the next person who accessed the same url. Example, I…
-
-2
votes2
answers116
viewsIs there any way to simplify this amount of conditions?
I have the following code: foreach (var lote in collection.ToList()) { count++; ushort[] dadosBalanca = new ushort[9]; if (lote.AlvoPasso > ushort.MaxValue) { var subtracao = (lote.AlvoPasso -…
-
-2
votes1
answer64
viewsC#XML Namespace Control
Hello! I’m building an XML file and it has the xmlns attribute in the parent element, but I don’t want it to appear in the child as is happening below: Follow the code in C language#:…
-
-2
votes2
answers1455
viewsError in Datetime.Tryparse
I have a problem with a conversion using the code below: string vcto = "29/01/2018"; DateTime data; Boolean resp = DateTime.TryParse(vcto, out data); if (resp == false) { MessageBox.Show("ERRO NA…
-
-2
votes2
answers116
viewsProblem to send values of type 11.50 to SQL Server database
I have a problem formatting values type R$ when sending to the data bank 11.50 in the data bank is type 1150. This condition is from the send button to the database has a database management class…
-
-2
votes2
answers441
viewsError 1 No Overload for method 'Inherited method' takes 1 Arguments
Error 1 No Overload for method 'Inherited method' takes 1 Arguments Code: public void restauraRegistro(DataGridViewRow linha) { try { string codigo = String.Empty; //verifica se e para recuperar com…
-
-2
votes1
answer385
viewsCompare lists that are exactly the same
I’m trying to implement a list comparison method that checks if they are equal. It must return true when the two lists passed by parameter are exactly equal (number of elements, elements and…
-
-2
votes2
answers1436
viewsTake variable value in another method
Inside the same file I have 2 methods: public IActionResult OnGet(){ CarregarMenu(); //Gostaria de pegar aqui o valor da variável lcMenuPrincipal Return Page(); } And the other: public static void…
-
-2
votes1
answer819
viewsBoletos.Net com . NET Core(v2.0) C#
I am trying to use Boletosnet to generate a boleto and later a PDF of it, but when I try to use any method of the library, an error is shown "Reference to type "Control" declares that it is set in…
-
-2
votes0
answers28
viewsDifference in Sql Server value To C#
Guys I’m converting this formula here to a C code#: declare @decPorcDescuentoTotal DECIMAL(18, 5), @decImporteCuota DECIMAL(18, 5), @decImporteSA DECIMAL(18, 5), @intCantCuotas INT set…
-
-2
votes0
answers10
viewsLearn . NET Core
I have been developing for a while in . NET Framework (webforms, windows Forms) and am learning . NET Framework MVC. I saw Maniero’s response in several posts talking about Core and the "death" of…
-
-2
votes2
answers143
viewsInstantiating a class as being property of another class
I have the classes: using System; namespace Model { public class Profissionais { public int idProfissional { get; set; } public String Nome { get; set; } public String CPF { get; set; } public…
-
-2
votes1
answer180
viewsC# Generate random and unique number, check the database if any equal number has already been generated and if you have to generate another number again
I’m developing a system where I need to generate one random number and single and write to the bank, this system will run every day generating new numbers based on business rules. With the help of…
-
-2
votes1
answer117
viewsThe latest versions (after version 5.0.0 ) of the Entity core framework are experiencing a failure to install in my project. Is this a general error?
When trying to install the latest version of Entity Framework Core in a project, using Visual Studio 2019, via Microsoft’s Install-Package command.Entityframeworkcore, I came across the following…
-
-2
votes1
answer66
viewsStack overflow exception being generated in the instance method "Equals()"
I created a class called MyList<T>, with the intention of reproducing the class List, and I overwrote the method Equals to compare your instance with another of the same class, as follows:…
-
-2
votes1
answer56
viewsCreate and use DLL libraries written in C++ on . NET C#
Because of the fact. NET is reversible, I need to encode part of my program in C++, but I still need Windows Forms, so I thought I’d create Dlls written in C++ to perform some key tasks (like…
-
-3
votes5
answers2197
viewsHow to create a switch.. case with value ranges?
If a total of days is over 30 and under 60, I do something. If it’s over 60 and under 90 I do something else and so on. How do I do this case? Did the case is the best option?…
-
-3
votes1
answer1273
viewsHow to validate a regular expression text not allowing everything in white space?
I need to validate a line from a text file, where I already have part of the expression , but I lack the part where from position X to position Y I have 30 characters that correspond to the type…
-
-3
votes1
answer454
viewsCode build error in Unity
this asim using UnityEngine; public class PlayerMovement : MonoBehaviour { void Awack() { floorMask = LayerMask.GetMask ("Floor"); anim = getComponet <Animator> (); playerRigidbody =…
-
-3
votes1
answer109
viewsUnity code does not compile
using UnityEngine; using System.Collections; public class Player : MovingObject { public int pointsPerFood = 10; // Numero de pontos cada vez que pegar comida. public int pointsPerSoda = 20; // ""…
-
-3
votes2
answers63
views"Nullreferenceexeption error was unhandled" when compiling
Follow the code below: public partial class Form1 : Form { public Form1() { button1.Click += Button1_Click; } private void Button1_Click(object sender, EventArgs e) { decimal n1, n2, result; n1 =…
-
-3
votes1
answer445
viewsMessagebox appears twice
I have the following code which is triggered by Handles Button1.Click. Dim X, Cf As Double Dim A, B, C, D, J As String A = TextBox2.Text B = TextBox3.Text C = TextBox4.Text D = TextBox9.Text J =…
-
-3
votes2
answers89
viewsHow to iterate on a model in C# with variables that have number?
I have a model that was made by another developer where it has several fields like this: . . . Teste() teste = new Teste(); teste.campo_1 = 1; teste.campo_2 = 2; teste.campo_3 = 3; teste.campo_4 =…
-
-3
votes1
answer75
viewsHow to instantiate an Abstract class in C#?
I know the class abstract cannot be instantiated. But I need to call it in Windows Forms and I’m not getting it.
-
-3
votes1
answer519
viewsHow to insert date and time in oracle? via c#
I’m developing a desktop application and everything was working fine until the time I tried to insert the date and time generated by C# into an oracle table. Can someone teach me the query to insert…
-
-3
votes3
answers386
viewsThe user will have 3 attempts to set the password
The following form does not open when the password is correct and if it is wrong continues to pass even if the password has typed 3 times. private void btnEntrar_Click(object sender, EventArgs e) {…
-
-3
votes1
answer77
viewsError consuming web service with ajax (JSON) in Cordova app
Good evening I built a web servisse where there is a method that receives a string parameter, which I use to serialize to a class as follows: /*parte da classe cliente*/ public class Cliente {…
-
-4
votes1
answer1531
viewsWould it be possible to pass a string from one form to another?
Imagine a Form who asks you for a color, so would have a TextBox, and from that TextBox I wanted to press the button "OK" for example, this sends the text of that TextBox to another Form, so that it…
-
-4
votes1
answer202
viewsHow does this class work?
DataSet OleDbConnection OleDbCommand OleDbDataAdapter OleDbDataReader I still can not understand this class in .net. What are these datasets and etc? I’m wearing this: using System; using…
-
-4
votes1
answer67
viewsStatic Methods X Nonstatic Methods for Data Access Layer
I’m creating a layer in ADO.NET for data access and painted a question. It is good practice to have my methods of accessing data as Static instead of always having to instantiate the object and call…
-
-4
votes1
answer159
viewsImprove the performance of a pointer method
Here’s the code working: string string_pick(string text, string tag, char caractere) { int index = text.IndexOf(tag); return text.Substring(index + tag.Length, text.IndexOf(caractere, index +…
-
-4
votes1
answer92
viewsIf allows you to execute other unwanted lines
I want to make a program that allows you to manipulate and manage information about Cds that are stored in a text file. The file must save for each CD, the name of the author/group, CD name, year of…
-
-4
votes1
answer113
viewsWhat’s wrong with parole?
What the error in the parole below and how to resolve? private void Botão_Click(object sender, EventArgs e) { if(Pbox.Show();) Pbox.Hide(); else(Pbox.Hide();) Pbox.Show(); } private void…
-
-4
votes1
answer34
viewsHow to get the Membernames property with the index?
I started programming in C# a little while ago and I’m doing a validation treatment using Data Annotation with windows Forms, I have a problem that I can’t get the Membernames property from the…
-
-4
votes3
answers1367
viewsPlacing spaces between letters of a text
As if a certain string as "Something" was with spaces between the letters as for example "A l g u m a C o i s a"; as I do it in C#?
-
-4
votes1
answer59
viewsbutton to add a minute
Hello I have this code and I’d like to do a boot to add a minute to the time that’s running. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using…
-
-4
votes3
answers748
viewsURI 1021 gives 5% error
Read a floating point value to two decimal places. This value represents a monetary value. Then calculate the fewest possible banknotes and coins in which the value can be broken down. The banknotes…
-
-4
votes1
answer75
viewsReplace chunk of code C#
Guys, I have a question that I think you guys are gonna figure out. I have a login form of this with the following condition: private void button1_Click(object sender, EventArgs e) { if…
-
-5
votes2
answers204
viewsHow to save an array of chars in a variable?
I’m doing an encryption program, starting to reverse the string with the following code: namespace APS { class Program { public static void Main(string[] args) { string frase;…