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
-
3
votes2
answers4494
viewsScroll through a list of characters
I have a method that checks the number of characters in a string, and separates them into variables with the information as can be seen in this example. The problem is when you have a list of data…
-
3
votes2
answers429
viewsRun N threads and know when all finished running
I have the following problem, I need to run the same method N times in a for and know when all the threads they’ve finished running it. I needed something like this: foreach (MeuObjeto obj in…
-
3
votes1
answer332
viewsHow to format values with custom string formats?
I am developing a graphic and would like to put the values of the Y axis as the image below: I have verified that it is possible to do this through custom string formats in that way…
-
3
votes1
answer81
viewsNetframework dependencies in the project folder?
I would like to know whether it is possible to incorporate .dll that my project uses Netframework in its own folder. In this way it would not be necessary to install the Netframework on the client’s…
-
3
votes1
answer67
viewsRemove namespace or full names
My question is if there is any shortcut, command or Visual Studio function that removes namespace or full class names, for example: for you to add a Data Annotation without doing a using vc you have…
-
3
votes1
answer3145
viewsHow to take duplicate values from an Arraylist
I would like to know how I can separate the double values, an example: I have a Variable FormaPagto defined as a ArrayList, In this variable I have 6 data: 0 - Money 1 - Debit 2 - Debit 3 - Money 4…
-
3
votes1
answer562
viewsC# Mysql transaction in distinct classes and methods
How do I interact a transaction between 2 methods that are in different classes? In my method where I open the transaction is as follows: public string InserirFuncionarioM(FuncionariosDTO…
-
3
votes1
answer174
viewsChange color of a Row when VB expires . Net
I have a database with the following tables: Data Emissão and Data Expira. So I want that when the date of Data expira is equal to or greater than Data Emissao, to row change color to Vermelho and…
-
3
votes1
answer21
viewsFolderdialog in Consoleapplication C#
I am with a question related to Console Application, as I do to open a window similar to this where it is possible to select a FOLDER? It would be a resource like the one in Windowsforms where it is…
-
3
votes2
answers861
viewsDatepicker Asp.Net
I am developing an application and would like to put the date field that when it is clicked it displays a calendar for selection in this style: datapicker, but I don’t know how to.…
-
3
votes1
answer412
viewsDragdrop for files . txt Windows Forms
I wonder if it is possible to use Drag and Drop in Windows Forms for files outside the application, in this case, a . txt(As is possible in WPF). I only found examples using Listbox. If possible,…
-
3
votes1
answer310
viewsValidate custom fields of generated classes
To prevent validations made with Data Annotations are lost if the table structure changes, it is necessary to create another class with fields for validation and a class partial, path that this last…
-
3
votes0
answers4251
viewsHow to update ASP.NET website hosted at Locaweb
I’ve had a website running for four years on a client of mine. The site was developed in VB.Net, and Locaweb migrated its servers from Windows 2003 to 2008 and consequently changed the Trust Level…
-
3
votes1
answer311
viewsFixed Menu in Csharp
I would like to know how to have a fixed menu in c#, as the user moves the application, just change the context, similar to web pages.
-
3
votes1
answer613
viewsHow to start on MVC5 ASP.NET?
Hello! About a month ago I started to venture around the world of C# and then I started to study Framework .Net. Soon after I started to study ASP.NET due to the need in my company. Today I use…
-
3
votes1
answer35
viewsError while trying to pass ticket[i] = i;
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Testes { class Program { static void…
-
3
votes2
answers5849
viewsHow to cut a string?
Example: nome = "Josénildo da Silva Ramos do Carmo"; Cut to have up to X characters, and look like this: nome = "Josénildo da Silva "; In this case I cut to 20 characters. How do I do this in C#? I…
-
3
votes3
answers1719
viewsVery slow C# and MVC site
I developed a site in MVC and C#, but after deploying in Gogaddy server I have noticed that the first access is very, but very slow. I practically check if there is a logged in user, if I do not…
-
3
votes1
answer176
viewsComplex mapping Entity Framework
I am creating a class structure that follows the following form: Department -Service A department provides various types of service. A specific service can only be provided by one department, not by…
-
3
votes2
answers918
viewsHow to cast a typed class in C#?
I own the class Carro who inherits from the class Objeto and another class CarroTeste implementing the abstract class TesteBase that by its implements the interface ITeste, both (TesteBase and…
-
3
votes2
answers710
viewsWebservices with C#, make-up
I need to create a Webservice to export products. Creating Webservico is fine, but depending on the client, I will have to change the name of the elements. Example, Product Code element: Generic…
-
3
votes1
answer769
viewsHow to kill a specific user process on Windows Server?
I have a C# application that at the end needs to kill a user process that ran, but as I am in a Terminal Server (Windows Server) and there are several users logged, when I put the command to kill…
-
3
votes1
answer743
viewsHow to change a property during a LINQ query?
Is there any way to change in the LINQ query a property of the query itself? Ex.: I’m doing a consultation on a List<Cliente> and I want all customers whose NomeFantasia begin with * have the…
-
3
votes1
answer252
viewsMore performative way to return data to the View
In a view where we return a list of objects, and we need to demonstrate the quantity, as a small report, using some conditions. What is the most performative way to return data to view? Explaining…
-
3
votes4
answers4241
viewsHow to get the amount of records in a query in Sqlite?
I am listing the records of a table with the code below: SQLiteCommand comando = new SQLiteCommand("SELECT * FROM Cadastro " +filtro, conn); SQLiteDataReader receber = comando.ExecuteReader(); But…
-
3
votes1
answer152
viewsSubstring(string.Indexof) is returning unwanted parts
I’m capturing a music site. I would like to return only 2 artist information and the music. She is in this code snippet: <div class="nowOnAir"> <a…
-
3
votes3
answers2918
viewsFormat a string with time
I’m trying to format a string that already has date and time, but this string just gotta get the time I’m trying this way but it doesn’t work: Recovering from Data Base. string dtSolicitacao =…
-
3
votes1
answer1030
viewsConvert String to monetary value in ASP.NET MVC
How to convert the result of a multiplication into a string to display as Real? The value of bol.ValorBoleto is loaded just before. To data Annotation: [DisplayFormat(ApplyFormatInEditMode = false,…
-
3
votes2
answers135
viewsJavascript - Populate a field with paragraph
I am developing a javascript to popular a text box, but I came across a situation that is causing me difficulty. Need popular with this message for example: TEST TEST TEST But I’m not getting to…
-
3
votes1
answer199
viewsUpdate Mongodb in array
{ "_id" : "55dcb404478e7227203d3a65", "Nome" : "Grupo Familia", "Pessoas" : [ { "PessoaId" : "55dcb425478e72207833e970", "Nome" : "Carlos", "Habilidades" : [ { "HabilidadeId" :…
-
3
votes1
answer1543
viewsCorrect use of async and await in Asp.Net
I am creating an asynchronous method for sending Emails from the opening or changing of the object, but when calling the method of sending email I have to put the await in front and the return of…
-
3
votes1
answer1072
viewsApplication pool hangs and no back application
I have a system in MVC4 on . NET 4.0 that is running on IIS 7. It generates the following error in Event Viewer: Event code: 3005 Event message: An unhandled exception has occurred. Event time:…
-
3
votes4
answers11622
viewsIs it possible for a Javascript function to call a method that is in the Behind code of the page?
I have a button and I wanted to program the click of it, and when I wear a <asp:Button> I program the click of him in the code Behind. Now I’m wearing a button normal. I know almost nothing…
-
3
votes2
answers700
viewsHow to add a`ul` to a`li` HTML element via c#code?
I’m going to have a list of multiple clients, and I wanted to add these clients to one ul of the element li in HTML, you can add these clients dynamically (because each search performed on the…
-
3
votes2
answers208
viewsI need a code that gives the error Accessviolationexception
My teacher passed a series of exercises and in them I need to create a code to give the error AccessViolationException. However I am not able to create a code that of this error (I am not willing to…
-
3
votes1
answer1361
viewsProgram memory cleaning in use
My application is accumulating memory, only thing it does, that’s the bottom. After 10-15 minutes, it comes to consume more than 1.5GB of memory, and continues consumption non-stop. Run a Timer…
-
3
votes1
answer100
viewsUse/Escape @ in CSHTML view
I have a jQuery code on the CSHTML page and I’m having trouble validating the email with a regular expression, because the @ is a Razor command in .NET. How to proceed to resolve this issue? Follows…
-
3
votes1
answer329
viewsHow to write bit information to SQL Server database?
I am developing a VB registration system and need help to record the information of a CheckBox in the SQL Server database. The column is in bit in the database, I don’t know how to pass the…
-
3
votes2
answers84
viewsReturn the path value
To return the value with the name of a folder in C#? Example, if executed: Directory.GetFiles("%PROGRAMFILES% (x86)\MyApp", "*.*", true); And if he succeeds he returns like this: %PROGRAMFILES%…
-
3
votes2
answers94
viewsSimplify LINQ p => p.Tipo.Toupper(). Equals("S") && p.Modo.Toupper(). Equals("S")...,n
How to simplify LINQ expression? p => p.Tipo.ToUpper().Equals("S") && p.Modo.ToUpper().Equals("S")...,n
-
3
votes1
answer177
viewsCan you use Firebird by accessing from your Windows Phone?
I developed a C# Windows Forms application with Visual Studio 2013 and Firebird database, but I would like to make a small application to facilitate access to the system. However in this application…
-
3
votes3
answers8198
views -
3
votes2
answers3291
viewsObtain the number of decimals of one decimal
How can I get the number of decimals of a variable decimal? Ex.: If I receive the number: 4.5 - you must return 1 5.65 - you must return 2 6.997 - must return 3 I know what you can do by converting…
-
3
votes2
answers1257
viewsError when configuring application in IIS Local (Integrated pool)
Personal hail, I am new with . net and am in error when creating an application in iis local. Below print of the exception and my pool. My iis resources and project are the same as a friend’s and on…
-
3
votes1
answer449
viewsAdd line to Datagrid with Datasource defined
I have a DataGridView who has the DataSource setate with List<MinhaClasse> and would like to add a new line to it. I know this is not possible using the method AddRow() of DataGrid. Is there…
-
3
votes1
answer8989
viewsHow to add an element to a list?
What is the correct syntax to call the method Add_Pessoa class ClsPessoa by a List? public class ClsPessoa { private static string PSTR_Nome = ""; private static DateTime PDT_DataNascimento; private…
-
3
votes2
answers181
viewsReturn a similar path value
No result in my post, i would like to know how the function would be used Directory.GetFiles, to list the files and folders within it without showing the full path. Ex: public List Listar(String a){…
-
3
votes1
answer106
viewsFood list gives "Index out of range"
In my system, I need to return to the number of questions that the student missed on a particular topic. To achieve this, I tried creating a class that has two attributes: Tema and QteErros and…
-
3
votes1
answer811
viewsIs it possible to return the child class through a method in the parent class?
I’m making a Builder and I’d like you to behave as follows: abstract class ClassePaiBuilder { public ClassePaiBuilder SetAtributo(string atributo) { // codigo return this; } public string Build() {…
-
3
votes1
answer304
viewsGenerate sequential key based on sum of digits
I have a cyclic function where a string may have any value in the checker digit, but all future submissions receive a pre-calculated value. In this role, I receive a string (which will always be a…