Most voted "c#" questions
This tag should be used when the question refers to some resource, information or problem related to the C#language. C# ("C Sharp") is a multi-paradigm programming language that has strongly typed variables, is imperative, declarative, functional, generic, object-oriented and component-oriented, which are designed to be executed in . NET Framework.
Learn more…13,899 questions
Sort by count of
-
-1
votes1
answer56
viewsSearch a word or number inside the Archive
I’m trying to make a system that searches inside the files txt of a folder through the name entered in texbox, and after locating files containing the information the system should move all to…
-
-1
votes1
answer30
viewswith I do to print multiples of N in a range in C language, my code does not run
#include <stdio.h> #include <stdlib.h> #include <conio.h> #include <string.h> #include <math.h> main() { int n, a, b; scanf("%d %d %d", &n, &a, &b);…
-
-1
votes1
answer21
viewsGet all classes that implement Classmapping<>
List<Type> entityMappings = new List<Type>(); IEnumerable<Type> allTypesInThisAssembly = Assembly.GetExecutingAssembly().GetTypes(); foreach (Type type in allTypesInThisAssembly) {…
-
-1
votes1
answer114
viewsMicrosoft.AspNetCore.Spaservices.Extensions. Does not exist
I just installed VS2019 into my new machine. And to test, I created a simple project. I noticed you no longer have the . net 3.1 but the 5. But my projects are in version 3 and I need them to…
-
-1
votes1
answer38
viewsMake panel invisible when opening Form
My program is opening a form2 inside a panel in Form1, I want when I close this form2 my panel is invisible private void button1_Click(object sender, EventArgs e) { panelPrinc.Visible = true; Form2…
-
-1
votes1
answer29
viewsException in Selenium Webdriver c#
Hello, I’m having trouble at this point: Openqa.Selenium.Nosuchelementexception: 'no such element: Unable to locate element: {"method":"link text","selector":"Issue Payment Guide (DAS)"} (Session…
-
-1
votes2
answers65
viewsTostring csharp best practice envelope
I see some programmers choosing to overwrite ToString in C# among some cases, my doubt, it is a bad practice to override this in specific or even depends on the programmer decide? Example: public…
c#asked 3 years, 4 months ago Raul Marciano 52 -
-1
votes1
answer45
viewsCalculate the chargeback in percentage of the final value C#
Good evening, the question is more about calculation than programming. The problem is this: if I sell something I must add 15% service charge. var total = 100; var acrescimoPercent = 15.00; var…
-
-1
votes1
answer35
viewsError [Nullreferenceexception] - Unity in C#
My code is not working, causing the following error: Nullreferenceexception The point is to jump, but I can only walk: public class player : MonoBehaviour { public float Speed; private Rigidbody2D…
c#asked 3 years, 3 months ago Erick Cavalcante Santos 11 -
-1
votes2
answers880
viewsselect name in bank with C#
I am developing an application in C# windows form in 3 layers. My problem is: I have a datagridview to receive data from the bank and a textbox to be typed the name I want to search for in the bank,…
-
-1
votes1
answer23
viewsC#: Number formatting (with dot)
I’m working on ASP.NET Core MVC and C#. I needed to present the number, e.g., (double) 1000, as 1,000, when presently the number is presented as 1000 . The property in the model is as:…
-
-1
votes1
answer20
viewsC# Scrpits that are imported as a component in UNITY of the not found error every time you close the program
After restarting Unity the image error appears for all the project scripts. I created the script and imported and also tried to create direct by Add Component to check if it would not disappear, but…
-
-1
votes0
answers19
viewsTwo Foreign Keys of the Same Class C#
I am starting learning in EF Core and I am putting together a "little project" to follow the course. Okay, that’s enough to find the first difficulty. I need to create and link two classes where the…
-
-1
votes0
answers17
viewsDoubt about stack
On a stack, the first element is set to top and the last element inserted as the base of the stack. That statement is incorrect right?
-
-1
votes0
answers19
viewsHow does the "Using" directive find Nuget packages?
Hello, I’m beginner in programming, I’m using. NET and after installing a package by Nuget did not understand how the Using directive finds the package I want, as well as its classes. I don’t know…
-
-1
votes0
answers17
viewsHow to set a (future) test-only date during a debug? (visual studio)
I have to test the system with some special dates. I currently do this manually, IE, where there is a "Datetime.Now" put a breakpoint and Seto the date I want. Another way is by changing the windows…
-
-1
votes0
answers8
viewsViewbag always comes up empty, does anyone know why ? Asp . net C#
[![View I need to return the url that was at the time of editing a record , he always ends up going back to the index , because the returnurl only comes null…
-
-1
votes0
answers11
viewsIs there a similar Python OS module in C#?
Is there a gang?? And if possible you explain?? I’m very young in C#. In case you haven’t read the title, I am looking for a library or module like Python OS in C#, and so far I haven’t found it,…
-
-1
votes0
answers13
viewsDev Back End Junior
Good afternoon, I am starting my career in the T.I branch and would like to know which programming languages is suitable for beginner back end developer?
c#asked 3 years, 2 months ago Hellen Thaise Dos Santos 9 -
-1
votes1
answer154
viewsType varbinary sql server attribute with c#
That column DocumentoPDF until now it was not used by the: I mean I was always null, however at some point added values and then error occurred in my query linq and the problem is that at the moment…
-
-1
votes2
answers939
viewsI can’t find a resolution for that mistake
I have a C# program and it is giving MANY bugs different, I’ll send everyone here, as follows: Code Error: Description: So come on. internal AcessoAdd() { InitializeComponent(); } Error:…
-
-1
votes1
answer52
viewsInsert MYSQL error by data grid view
the code is as follows, I am making an Insert from values of a data grid view foreach (DataGridViewRow row in dgvCON.Rows) { MySqlCommand cmd = new MySqlCommand(); cmd =…
-
-1
votes2
answers3552
viewsAdd values to a C#list
Hi! I am reading values from a table and inserting them into a list. What I have is this: Expiração.Add(rdr["Name" + "Address"].ToString()); Expiração.Add(rdr["Address"].ToString());…
-
-1
votes1
answer186
viewsEnable a button after entering password
I need some help, but I don’t know how I can make this code. I have a form and in this form I have a button that deletes in an SQL table, I want to make the button is disabled and to enable it I…
c#asked 7 years, 4 months ago Junior Guerreiro 617 -
-1
votes1
answer249
viewsWait for an event to be triggered to continue the C#
In the method RealizarPesquisa, when executing the line _WebBrowser.Navigate(), the event is triggered DocumentCompleted(), but this event it takes a while to be executed, so the method…
-
-1
votes4
answers166
viewsC# WPF How to separate a long string into several positions of an Array?
I need to create a getter and a Setter for 14 Model properties that will be used to make Binding in Xaml. The properties come from here: I have a field from a database table where it loads a very…
-
-1
votes1
answer605
viewscheckbox in datagridview
I am developing an application in c# that makes impression of labels, for this to happen I use a datagridview, which brings the lines I need to print, now I need to put a checkbox to select the line…
-
-1
votes1
answer252
viewsSelect particular view for view - ASP. NET MVC
I am learning the ASP.NET MVC and I came across a situation that would like your help. I have a view that shows the result of a database query on the screen. Each record shown has an identification…
-
-1
votes3
answers186
viewsHow do I trigger confirm the form via enter?
I’m doing a C# program that plays what’s inside the TextBox into the Grid, But I’m only getting it through a button. I want to know how to make the supplier user the first data, press enter, skip to…
-
-1
votes1
answer56
views -
-1
votes1
answer241
viewsProgressive Web Apps switching pages inside the app without opening browser
I have a mobile page (http://mvc-decea.azurewebsites.net) based on Progressive Web Apps and made using Asp.Net Core. But I’m in so much trouble: When adding to the mobile home screen by clicking on…
-
-1
votes2
answers742
viewsI can’t get a variable from another namespace
A project is Webapplication and the other one is like Console: "Projectste" Nomedasolution Structure below: Business(Pasta) Businessdal(project) Arquivodal.Cs Console(project) Business.Cs //Project…
-
-1
votes3
answers590
viewsHow do I know if one string contains another?
I have a List<string> with four items: C:\Users\Producao\OneDrive\VisualStudio2017\siteRelatorios\bpa\Content\Upload\LFCES004.txtb9109712-d3f2-4151-bbac-7fbc82ed99de…
c#asked 7 years, 3 months ago Italo Rodrigo 4,344 -
-1
votes1
answer196
viewsCreate tree structure from a database query
I have a database query that results in the following table: How to turn this query into a tree structure like the one below in c#? tree = [{ text = cliente1, items = {[ text = cojunto1, items =[{…
-
-1
votes1
answer47
viewsModal passing data null
When saving to my modal the Controller receives Null. 1 - Modal model @model WebAutenticado.Models.CAD_DEVP @{ Layout = "~/Views/Shared/_LayoutModal.cshtml"; } @using (Html.BeginForm()) {…
-
-1
votes2
answers94
viewsProblem when receiving char values
Why the first time I pass an error char value (as if it were empty)? Then the second try works normal? After I received the initial post or shift of error and yet I gave one Writeline was with the…
-
-1
votes1
answer28
viewsButton does not appear in the App
I made a button, listview. The listview is working because I started it, but how do I do with button? Below my code: protected override async void OnAppearing() { base.OnAppearing();…
-
-1
votes2
answers331
viewsDay count of a date
I needed this parameter to count the days until the date I type for example (31/12/2016) as shown in the attached image, but it is only returning the number of days that was typed in the case 31…
-
-1
votes1
answer575
viewsC Sharp : error Object Reference not set to an instance of an Object
Guys, I’m a beginner in C Sharp, and using VS community, so I found a web cam program and adapted the code to where I want to use here, but when I click save image, it appears this error: error…
c#asked 7 years, 2 months ago Felipe Deolindo 179 -
-1
votes2
answers76
viewsHow can I create a list
I need to create a list, where it will list all existing items within an order. In the method below I can bring an item, but I can’t bring it if I have more than one. My doubt would be, I have to…
-
-1
votes2
answers309
viewsIntegration between Console Application, Webservice and Frontend Web C#
I am developing my TCC and need guidance on how best to do some parts of the system. Description: It is a system for optimizing the use of laboratories. Such a system should have web frontend on the…
-
-1
votes1
answer110
viewsHow to edit items in sqlite.net with Xamarin
I’m learning to use sqlite.net in the Xamarin, but when editing an item is not working, I debug the code and gave a breakpoint in the EditItens() and saw that the values passed to…
-
-1
votes1
answer406
viewsWeb-Service returning maximum quota exceeded. How to resolve?
I’m consuming a third-party web-service. When I get the return from the service the following message is displayed: Maximum input message size (65536) exceeded I’ve searched forums for a solution,…
-
-1
votes1
answer81
viewsHow to return the value of the element using Xpath?
I’m doing a job for the college where I need to return the titles of the news site G1 - World. I am using Htmlagilitypack. As an example, the first news of the site appears in this code snippet…
-
-1
votes3
answers79
viewsC# doubling value alone
I’m appending C#, but the code below doubles the value and terminates unexpectedly. Can anyone take a look? using System; using System.Collections.Generic; using System.Linq; using System.Text;…
-
-1
votes1
answer940
viewsNaval battle program c#
I have to make a naval battle game for college using windows Forms in visual studio, the problem is that I could not understand the logic to generate naval battle maps, I can not think of a way to…
-
-1
votes1
answer151
viewsEntity Framework 6: Error getting SQL Server record
I can enter records in the bank normally, however, when trying to get, it gives error in EF. public class Program { public static void Main(string[] args) { new…
-
-1
votes1
answer1032
viewsC# Windows Forms - Getting the ID of a Logged-in User
I need to take the ID of an already logged in user to create another product. How do I do this ? So, soon, and with the email and password logged in, I want to find the ID logged in for when I…
-
-1
votes1
answer4231
viewsWhen using Boleto.NET is it necessary to assemble the shipment file manually?
In a financial system already built by another developer the Boleto.NET library was used to generate boletos Itaú. I would need to add support for Santander billet generation, but I can’t figure out…
-
-1
votes1
answer873
viewsPDF generated with iTextSharp adding image gets bad quality
I have an image file that I need to pass to PDF and for this I am using the iTextSharp. So I’m trying this way: private static void Main(string[] args) { using (var stream = new…