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
-
0
votes1
answer71
viewsEntity Framework database access
I got a C# . NET application developed with Entity Framework, but I can’t access the database, with the following message: The underlying pdovider failed to Open. I only have the application, but no…
-
0
votes1
answer67
viewsHow to stop a windows Forms application until a form is closed?
I want when Form1 is opened, the whole program stops, and only comes back when it is closed. How can I do this? Code that opens Form1: if (x == DialogResult.Yes) { Form1 f1 = new Form1(); f1.Show();…
-
0
votes2
answers32
viewsMacagent Xamarin
I have Visual Studio 2017 installed on Windows. And on my Mac Xcode. To compile projects in VS 2017 via Windows, I can connect to a Mac, Via Macagent. My question is, on my Mac I only need Xcode…
-
0
votes1
answer326
viewsUsing methods from a project written in C++ in C# (Same Solution)
Hello, I need to consume methods written in C++ in a project written in C#, within . NET (both) and that are contained in the same Solution (as shown in the image below) I tried to compile the…
-
0
votes1
answer128
viewsXamarin.Forms - Shared Project x PCL
When I design a project in Xamarin.Forms, it allows you to choose between: Shared Project and PCL. What’s the difference between the two? What advantages and disadvantages?
-
0
votes1
answer77
viewsHow to fill out INPI data in a . NET project
My question is somewhat conceptual. My company registered the software in the INPI and received protocol data, etc. How to fill this data in my system? I noticed that in the file AssemblyInfo.cs i…
-
0
votes1
answer44
viewsProblem with for and string. Remove
I’m having a problem with a program that I did for encryption and decryption from a hash, don’t judge how it works, I did it while it was very tied. What is not working is the Decrypt, I believe it…
-
0
votes0
answers147
viewsProblems with PDF file
I am showing a PDF file directly in the browser. In Google Chrome, it works perfectly, but if you use Firefox, the PDF is as shown below. Did you have to put some extra config for Firefox? The PDF…
-
0
votes2
answers1212
viewsHow to use and what is the timer function in C#?
//Exemplo de uso(Que não entendi): using System; using System.Threading; public static class Program { public static void Main() { // Create a Timer object that knows to call our TimerCallback //…
-
0
votes0
answers792
viewsCannot load file or Assembly 'Microsoft.Office.Interop.Excel'
I am trying to open an old ASP.NET project on my machine and I am getting the following error when I try to run it to view in the browser: Server Error in '/' Application. Configuration Error…
-
0
votes1
answer49
viewsHow to use Segmented Controls in Xamarin Forms
Galley, A help, I need to use a type of Segmented Controls in my Xamarin Forms. However, it does not exist. I saw that to use Native by platform, but found no example or documentation guide to it.…
-
0
votes1
answer36
viewsWhat class is similar to Aescryptoserviceprovider in . NET Core?
I am migrating an application to . net core and need to use the AesCryptoServiceProvider, that worked perfectly in other versions of . NET Framework. But when using on . NET Core Visual Studio warns…
-
0
votes2
answers114
viewsHow to receive information in a View?
I programmed my controller as follows: [HttpPost] public ActionResult Login(string pUsuario, string pSenha) { usuario oUsuario = modelOff.usuarios.Where(p => p.usuario1 == pUsuario &&…
-
0
votes0
answers35
viewsAlternate Webbrowser running recent pages
I would like to know if there is any control for the platform . NET that runs current pages without giving errors. I’ve looked on Youtube, Google, but I never do. Awesomium.NET doesn’t change.…
-
0
votes1
answer117
viewsHow do I compile this project in C#?
I’m having trouble compiling with the CSC command on prompt And there’s a "namespace" error I can’t fix. I don’t know if I’m doing it right. Project link.…
-
0
votes0
answers59
viewsStream that reads byte per byte?
I created a simple byte-by-byte reading method in a stream, but it’s very slow and it’s taking minutes to process a ten-megabyte file, I don’t know why it’s so slow. It needs to be byte-by-byte and…
-
0
votes0
answers192
viewssql related error
Good night, I am trying to register in my application, but is returning me the following error: Instance-specific or network error when connecting to SQL Server. The server was not found or not…
-
0
votes1
answer99
viewsCan you store hash code in a database?
I was reading some questions here and a doubt has arisen in one of these questions. If I have an application that I need to store strings in a database to compare later with something, but I don’t…
-
0
votes1
answer94
viewsThe "Mailaddress.Displayname" property or indexer cannot be assigned, as it is read-only
I can already send an email normally. I just can’t change DisplayName. Follows code : var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>"; var…
-
0
votes2
answers1699
viewsFind out if it is even or odd in array
I’m trying to define the even and odd numbers of a total of 5 numbers entered by the user in a vector. int[] atividade = new int[6]; for (int i = 1; i < 6; i++) { Console.WriteLine("Insira o " +…
-
0
votes1
answer71
viewsPopular Gridview with Access Data
I managed to do this in VB.NET, but now I need to do it in C#and I can’t turn the code the right way. I have this Gridview: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"…
-
0
votes1
answer415
viewsC# Visual Studio unknown build error
I went to refactor my code in C# that was working perfectly, but it was gigantic, and it stopped working and the visual studio does not describe the error in any corner. Below is my code and Visual…
-
0
votes1
answer398
viewsHow to run programs without specific path
Example: I want you to automatically do a search of the program I write, and if you find an application ". exe" it run it, if not find, send a message saying that the program is not installed on the…
-
0
votes2
answers183
viewsReference System.Configuration
I’m trying to use the System.Configuration reference to finish integrating the instances of my code with a block .txt. However, I noticed that unlike the Visual Studios present in youtube videos,…
-
0
votes3
answers58
viewsNullreferenceexception error in Join
I created a Join in LINQ to create a List: (from p in listaProcedimento join pd in oListaprocedimentodetalhe on p.codigo equals pd.codigoProcedimento into pd1 from pd2 in pd1.DefaultIfEmpty() select…
-
0
votes1
answer60
viewsGeneric method for locating a specific value in several types of similar structures
public enum EXEMPLOENUMERADOR1 { blablabla1, blablabla2 } public enum EXEMPLOENUMERADOR2 { blablabla3, blablabla4, blablabla5} public enum EXEMPLOENUMERADOR3 { blablabla6, blablabla7, blablabla8,…
-
0
votes2
answers111
views -
0
votes2
answers3813
viewsHow to truncate decimal in X decimal places?
I am using the following code, but when sending ex:'10.100' to 2 houses it returns '10.1', but it should be '10.10' public decimal TruncarDecimal(decimal value, int decimalPlaces) { decimal…
-
0
votes0
answers236
viewsIgnore files from the Debug obj folder
I’m having a problem, every time I check in the visual studio relates these files : I created a file (.tfignore) to try to ignore them but it didn’t work : \packages \obj \bin \_design\.sass-cache…
-
0
votes2
answers271
viewsCheck if file exists for 20 seconds C#
I’m making a module that works with file exchange and the documentation asks to wait 20 seconds for the status file xxxxxxxx.However, I do not know how to implement this in C#. I was trying…
-
0
votes0
answers40
viewsAccess FK attribute in Entity Framewokr
I have the class Cliente who owns a IList<Produto> and the class of produto has a ClienteId (which is FK) and an attribute Cliente Cliente { get; set; }. How to access the attribute Nome of…
-
0
votes3
answers866
viewsEntering numerical data in the database
I’m having trouble inserting into the database the field is formatted as DECIMAL(10,2)), when I try to insert the direct monetary value by Mysql works with the endpoint instead of the comma ex:…
-
0
votes2
answers256
viewsShow "Loading..." while browsing between pages
When I make a call ajax I can already show/hide a loading gif like this: $(document).ajaxStart(function () { $('#loadingFull').fadeIn(); }).ajaxStop(function () { $('#loadingFull').fadeOut(); });…
-
0
votes2
answers64
viewsIs there anything in MVC that is equivalent to the <Asp:Repeater> of Web Forms?
I am mounting a form where some fields may or may not repeat, example: Course 1: Course [input text] Institution [input text] Year of completion [input text] Course 2: Course [input text]…
-
0
votes1
answer1632
viewsCommunication problems with the government-provided web service
I’m having a problem communicating with eSocial webservice, my certificate is correct, but still can’t establish a secure connection, it presents the following message: "Error making HTTP request to…
-
0
votes3
answers97
viewsHow to write times on console entries without repeating too much code
I wish that all Console.WriteLine this way when sent to the Console: [10:38:12:758]- Message typed in writeline Well I’ve already done a part that’s this: private static DateTime data =…
-
0
votes1
answer3703
viewsHow to get the encoding type of a file?
Follows code: string text = File.ReadAllText($@"{pathname}", Encoding.UTF8); I have several txt files with different condition. Because here shows no special characters, because different encoding.…
-
0
votes2
answers270
viewsHow do I compare values between two tables and send email if it has new value?
My system imports every day CSV files from several directories into a table called TB_ARQUIVO. In this file, it contains the name of the Hotel (HOTEL_NOME column) and four types of Channels...…
-
0
votes2
answers269
viewsReturn last record from table
I’m trying to make a method that returns the last record of the table but gives error: Failure in operation"coditem" public int UltimoItem() { con = conexao.obterConexao(); try { cmd = new…
-
0
votes3
answers838
viewsCheck Whether Datagridview field of type Datagridviewcheckboxcolumn is marked
I have a dataGridView and do the check to see if in the column of type Datagridviewcheckboxcolumn there are any selected lines. If there is at least one line with this selected field executing an…
-
0
votes0
answers33
viewsDelete a directory recursively
Looking at Microsoft documentation on the method System.IO.Directory.Delete(path, bool);i noticed that adding a true boolean in the second parameter makes it recursive. In my case, the folder I will…
-
0
votes1
answer303
viewsInstantiate a class that inherits an interface class
I have a class that inherits many interface classes, and I want to instantiate it to use only one method, how do I do? It is possible to do without passing all the necessary parameters? public class…
-
0
votes2
answers1142
viewsHow to Increase Time Timeout webForm
how to increase timeout time, my session is falling around 5 min, it is not in the connection string. Asp.Net Authentication Aspnet Identity <sessionState mode="InProc" timeout="20"/>…
-
0
votes2
answers4220
viewsAdjust Form layout according to monitor resolution
I made a form in fullscreen, where the monitor I use is 23'' inches. But where the functionality will be deployed, they use 19". When I executed, the Form did not get the size of the smaller…
-
0
votes2
answers138
viewsC# conversion error
I have the most generic class Account and another ContaPoupaça who inherits from that class Conta. In this daughter I have an interface called ITributavel, because this class beyond the methods and…
-
0
votes2
answers448
viewsThe "Color.Name" property or indexer cannot be assigned, as it is read-only
Follow code where I define SegundaTela: public partial class Form1 : Form { SegundaTela telaSecundaria; } Code: telaSecundaria = new SegundaTela(); telaSecundaria.label_segunda_tela.BackColor.Name =…
-
0
votes0
answers108
viewsSending Email is leaving the attachment path in the body of the email
I’d like some help! I made a class to send emails in my application, where reports will be generated to be sent in PDF and XML format, but the email is being sent with the path of the files in the…
-
0
votes1
answer118
viewsPrevent, confirm or Dismiss javascript Alerts in a VB.NET webbrowser object
I am facing problems with javascript alerts on my webbrowser. I’m creating an automation and after giving Ubmit on some pages in webbrowser, Javascript alerts appear with the protocol generated by…
-
0
votes1
answer211
viewsHelp to write to USERS and Aspnetusers at once
Help please. I’ve spent my whole day redoing various parts of the system, trying a lot of different solutions but ended up without ideas. I have a solution with several applications. One of these…
-
0
votes0
answers18
viewsMoving Cell from a Gridview C# desktop
This code does nothing more than drive a row selected on a datagridview. btnup -> plays the selected line up. butndown -> plays the selected line down. DOUBT: My question is, how to move only…