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
-
0
votes2
answers60
viewsError while reading a Json string
I’m trying to create a table for a football championship with the return of a json: To facilitate I will put the Json below refers only to a Team: { "id": "1", "nome": "Palmeiras", "Atleta": [ {…
-
0
votes0
answers49
viewsLoad one tab into another
I have a layout page where I want to upload information to the notifications button. For this, I made an action in the controller to return a Partialview where a query will be made in the bd looking…
-
0
votes4
answers370
viewsI don’t know how to use the method of converting images in Xamarin.forms.
I’m developing an app Xamarin.Forms and I’m having difficulty understanding how to fill the parameter to convert an image into byte array, I searched a lot looking for some solution, I found this…
-
0
votes1
answer104
viewsI click the button and do not add the div - C# Asp.Net
I click the button and it does not add me to div, but sends it to the database, someone can help me? C# protected void img_btn_enviar_nome_Click(object sender, EventArgs e) { UtilizadoresBot…
-
0
votes1
answer1190
viewsUnity Object Reference not set to an instance of an Object
I’m doing a quiz in Unity and I have an error that I can’t solve, I’ve researched similar errors but I can’t identify, this message appears when I’m running the quiz Nullreferenceexception: Object…
-
0
votes0
answers55
viewsTextbox.Selectall() works when going through the keyboard, when simulo no
Good staff, I have a way for 3 Textbox to run when they win Focus: private void NumericKeyboardTextBox_GotFocus(object sender, RoutedEventArgs e) { e.Handled = true; this.textBoxForNumeric = sender…
-
0
votes1
answer58
viewsWhat is the difference between these two types of standard values?
In C#, by creating a classe new with some properties, I should set some default value for the properties created, 0 in the case of a property of Saldoatual. What would be the difference between the…
c#asked 6 years, 1 month ago Victor Laio 2,043 -
0
votes0
answers161
viewsGet value from an entity via navigation property
I have a question that seems basic, but I’m racking my brain to solve. How can I get the value of an entity attribute via Properties Navigations? For example, I have the classes: public class Budget…
-
0
votes2
answers226
viewsHow to Insert a parameter from my system into an external URL
So, we have a website that when passing a user’s code, it shows the location of the same. Example of the URL:…
-
0
votes1
answer128
views -
0
votes1
answer207
viewsLoad combobox C# from another in Load()
It’s been so long since I’ve worked with Winforms, I’m missing something. In my Form Load I call this method below: private void CarregarEstados() { cboEstado.DataSource = Listas.ListaEstados();…
-
0
votes1
answer444
viewsFill vector with Textbox in C#
I’m trying to fill the positions of a vector with data input coming of a Textbox, and do the reading in a Listbox but I’m not getting it. Everything seems to work, but only inserts the last element…
c#asked 6 years, 1 month ago user98929 -
0
votes1
answer230
viewsHow to implement password encryption?
I want to implement password encryption in user registration. I found here in stackoverflow this post teaching how to use cryptography, but I’m in doubt where to add the code. This method should be…
-
0
votes1
answer303
viewsHow to do a search with Join using Entity framework Lambda and Linq
How do I search two or more tables. In the system I am doing, I have the tables Barco, Tipodeoperacaodobarco and Classebarco My mapping is as follows: HasRequired(c => c.ClasseBarco) .WithMany(c…
-
0
votes1
answer174
viewsIsolate presentation layer domain
Good software architecture practice says that the presentation layer does not You must know the domain layer. I’m trying to make this isolation between these layers, but the that is hindering this…
-
0
votes1
answer115
viewsUndefined object reference for an object instance. Array
Hi, My problem is in the array following this code: mesh meshCube; string[] file = File.ReadAllLines("object.mind"); foreach (string filetext in file) { if (filetext.Contains("v")) { string ext =…
-
0
votes1
answer25
viewsGlimpse ASP.Net working with Dapper
I just saw a piece of content where I studied performance and optimization in ASP.Net applications. I was presented with a diagnostic tool called Glimpse. The operation of the tool is perfect, it…
-
0
votes1
answer2001
viewsObject cannot be converted to dbnull in other types
Good afternoon gentlemen. I am making a user registration in the college work and when logging in this error appears. How can I solve? private Usuario Mapear(DataRow registro) { var usuario = new…
c# asp.net-mvc asp.net-mvc-5 asp.net-web-api asp.net-mvc-4asked 6 years, 1 month ago Vinicius Marson 63 -
0
votes2
answers148
viewsOpen connection more than once in C#
I am developing a service in c#. calls a function to check if it has active records. if you have any record call another function to select the data referring to the first query. When I run my…
-
0
votes1
answer37
viewsData from the same table for different views?
I have found it difficult to solve the following problem: Assuming I have the following structure in the database: Id int identity primary key CodigoBanco char(3) Descricao varchar(100) Endereco…
-
0
votes1
answer296
viewsError: "Cannot implicitly convert"void" to "Eventhandler"
I was trying to make a button that passed the information of an entry and a Stacklayout and this error appears to me: public MainPage() { InitializeComponent(); Entry entry = new Entry() { Keyboard…
-
0
votes1
answer525
viewsASP.NET MVC - How to upload a file with more than 5mb using ajax?
I am using the following code to perform file upload: HTML: <form action="/Employee/FileUpload?UnityId=1&ObjectId=1" data-ajax="true" data-ajax-failure="OnFailure" data-ajax-method="Post"…
-
0
votes0
answers107
viewsImages for the Asp.Net MVC Product
I have a problem, I don’t know how to save more than one image for a product. For example, an X product has a Highlight image (which is the one that will appear in the window), and 4 more images,…
-
0
votes1
answer35
viewsSet difficulty for a question and when selecting difficulty seek only those questions
Good afternoon! I am finishing a C# Quiz made in Unity. The question I have is, I have several questions that I would like to see an Asset. But I need to set the difficulties for each of the issues.…
-
0
votes1
answer115
viewsNo less `csc` works on Mono
Mono is a set of build tools. Before and after version 5.0, the Mono tools never worked, except csc. To clarify, although the version is not related to the problem, since the version 5.0 Mono has…
-
0
votes1
answer136
viewsXamarin.Forms - Listview only displays if I click on the screen.
Hello, I got a problem. Have my listview, where you bring the information as it should, but this information is only displayed when you click on the screen. If it is not clicked on the screen, the…
-
0
votes0
answers39
viewsCell does not show all information(.CSV)
I am generating a file . CSV in my project in c#. Most information is correct, but when it has a large number, the cell does not show all: and the file is generated like this: Call the Create…
-
0
votes0
answers44
viewsSave a datagrid column in the database
I need to get the value of the discount column from mine datagrid and save in my database, will I get, it is calculated when I record consumption according to quantity, follows below the code:…
-
0
votes2
answers107
viewsProblem with C#Threadstatic
I own a system where his authentication keeps a token in a Threadstatic property. It turns out that Monday, he started distributing the tokens incorrectly (after windows server update). I made the…
-
0
votes1
answer54
viewsWhen the property is not int how to force Entity to create a field in the table as nullable:false
Migration is generating the name field in the table as nullable:true i don’t want it to be true, as I do to solve this problem? public class Professor { public string Id { get; set; } public string…
c# sql-server entity-framework asp.net-core entity-framework-coreasked 6 years ago Robson Junior 29 -
0
votes3
answers799
viewsAligning Twiter bootstrap buttons inside a Table
My buttons inside the table are breaking the row when a column is added in the table, they are getting like this: My code ta as follows: <div class="row"> <div class="col-md-4"> @using…
-
0
votes1
answer54
viewsHello, my problem is that the email is being sent only when I check the email instead of showing the sender’s email shows the recipient’s
protected void btnEnviar_Click(object sender, EventArgs e) { string desEmail = "[email protected]"; string remetenteEmail = txtEmail.Text; //O e-mail do remetente …
-
0
votes1
answer188
viewsError "A graph element named '0' already exists under 'Seriescollection'"
I’m doing a program to do the image limiarization, and I wanted to show a graph with which grayscale most appear in the image. The first time the program works normal, but the second time it gives…
c#asked 6 years ago Tiago Cunico 3 -
0
votes1
answer480
viewsAsp.Net Core Webapi Returning Object List
I am trying to return a list of a "Plan" Template that has a list of "Expenses", returning only the plan list works, but when added to return the spending list of a javascript error. "Failed to load…
-
0
votes1
answer551
viewsError trying to save Asp . Net MVC image
Good morning People, I am trying to open, resize and save an image again through an ASP application. But I am getting an error when the image will be saved. Follow the code that is giving error:…
-
0
votes0
answers419
viewsHow to readjust the label of a Chart js chart?
How do I adjust the font size of the label or place a line break? The text is not fitting in full, for monitor 1080 fits, but 720 happens this. My code: <script> var myChartcaixa = new…
-
0
votes0
answers45
viewsC# - Reading Excel
I was able to read an excel file, but when showing console the information does not leave spaces, how can I give space in the middle? kkkk using System; using System.Collections.Generic; using…
-
0
votes1
answer289
viewsLockar SELECT when I do an UPDATE - Sqlserver
Let me give you an example of what I’m doing, but the question really is at the end. I have a table with 4.100.000 records and I am creating a robot that reads this data and exports it to MYSQL (not…
-
0
votes0
answers44
viewsUpdate data that has many to many relationship with Entity Framework
I’m trying to update an object and the only thing that doesn’t update is his relationship from many to many the rest as name and surname update [HttpPost] public IActionResult AtualizarProfessor(int…
-
0
votes2
answers86
viewsSave photo to database and then display it
I have an application to register students where will be inserted the photo, I want to save it and then display it, but I have a save button where I want to save all the inserted information plus…
-
0
votes1
answer34
viewsHow do I relocate the selected item from a Category List to the first position
In my application I have an area with several links of categories that is a Partialview. The categories below comes from the following statement of Categoriascontroller var categorias =…
-
0
votes1
answer56
viewsBinarywriter C#
I’m in a little trouble, i use BinaryWriter to write bytes and then send them as a response certainly I use it in the right way(I think). however, when I use it several times, I break point or…
-
0
votes0
answers92
viewsPrint on client side with C# MVC automatically
I need to automatically print a PDF file that is in a folder on the server, but the printing has to be in a specific printer on the CLIENT side. if (!String.IsNullOrEmpty(caminho)) { string…
-
0
votes0
answers247
viewsSystem.Missingmethodexception: No constructor without parameters has been defined for this object
I’m getting the following error: System.Missingmethodexception: No constructor without parameters has been defined for this object. My Controller: using BecomexTeste.Models; using…
-
0
votes0
answers123
viewsDependency Injection - Web Api
Good Afternoon, I’m trying to create the dependency injection in the Web Api, but I’m not getting it, I get the following error: SimpleInjector.DiagnosticVerificationException Hresult=0x80131500…
-
0
votes1
answer78
viewsNull object with jquery ajax MVC3
I know I must be forgetting something. I am making a request ajax jquery to send a message via contact form, however the object is coming null on controller. I tried doing with the JSON.stringfy and…
-
0
votes1
answer75
viewshow do I have information passed to the textbox from id
He wanted the MRI of the student (primary key) to be filled the textbox with the information related to that student. CREATE TABLE ALUNO( RM_ALUNO INT NOT NULL, NM_ALUNO VARCHAR (40) NOT NULL,…
-
0
votes1
answer219
viewsNot all paths return value
The event Cadastrar is appearing with the error. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using CamadaModelo; using…
-
0
votes1
answer958
viewsCalling the API with Httpclient - POST
It’s the first time I’ve developed something like this, so I don’t really know what could be wrong. I’m making a call to an API with the HttpClient, thus: private string autenticar() { try { using…
-
0
votes1
answer55
viewsProblems contacting Domain Controller
I made a program that accesses directories on the network. This program uses the windows API WNetAddConnection2. An example of implementing this API is available in C# in the SOEN. Here is the code…
c#asked 6 years ago Bruno Costa 5,878