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
votes2
answers991
viewsTransform matrix into vector
I am doing some exercises with matrix and array, and I arrived at the following situation: static void Main(string[] args) { int linha = 3; int coluna = 3; int[,] matriz = new int[linha, coluna];…
-
-1
votes2
answers46
viewsDo parameters harm physics in Unity update method?
Well, basically I created a Playercontroller class and was separating some methods until creating a Playermechanics method(float jumpForce, etc...). When placing this method inside Update() I…
-
-1
votes1
answer44
viewsC# deserializar Enum that does not exist
I have a class that has as attribute an Enum, for example the class below: public enum Model { Volvo = 1, Ferrari = 2, Gurgel = 3 } public class Car { public Model model { get; private set; } public…
-
-1
votes1
answer204
viewsPagination with search
I am trying to create a search in a grid with paging, but when it brings the search result it generates a new pagination but when I click on page 2 it brings all the results ignoring the search and…
-
-1
votes1
answer24
viewse. Hasmorepages stays in Infinite Loop
I am trying to create a medium of printing meats, however the e.Hasmorepages keeps adding pages and does not stop according to the amounts of parcels in the meat. public static string Impressora;…
c#asked 4 years, 9 months ago Rayan Dutra 1 -
-1
votes1
answer56
viewsUpdate oracle via c#
I created a method that updates to oracle. However, it is absurdly slow when it does. When I do other operations like "INSERT and SELECT" in this same table, the response time is very fast. Could…
-
-1
votes1
answer17
viewsGet local connection string, working with (Azure Function)
I would like to know how to pass a connection string to my function, that’s the local.settings.json I found in the documentation of Microsoft { "IsEncrypted": false, "Values": {…
c#asked 4 years, 9 months ago Luan Oliveira 3 -
-1
votes1
answer164
viewsError 'System.Collections.Generic.Keynotfoundexception' occurred in mscorlib.dll
I created an application in visual studio 2017, I formatted the pc and installed the 2019 version and since then no application I try to connect to the database works. always appears this error: An…
c# mysql visual-studio-2015 mysql-workbench visual-studio-2017asked 4 years, 9 months ago Guilherme Costa 1 -
-1
votes1
answer34
viewsSending an E-mail c#
Guys, I need help. I have the following email sending controller, where I send an email for password retrieval. this email will be sent from a simple html I have in the templates folder. My doubt is…
-
-1
votes1
answer109
viewsHow to resolve the Csharp_eidmw_err_pinref_not_found_get exception
I have a C# project that uses the Gov library to access data from a smartcard (citizen card), the Library is called pteidlib_dotnet, which you can find here I need to create a feature that allows me…
c#asked 4 years, 9 months ago BarrosKing 138 -
-1
votes2
answers140
viewsHow to return error message with API
Good morning, I’m trying to return error message when something goes wrong in the api, I’ve done it for all the request of the api, but for one specific error, the action that shows all users that…
c#asked 4 years, 8 months ago Pedro Pinheiro 248 -
-1
votes2
answers53
viewsChange picture box by clicking on a label
Good afternoon, could someone help me? I would like to click on a label my picturebox changed. I’m doing a quiz in windows form and type,picturebox function as the (wallpaper button) and the label…
c#asked 4 years, 8 months ago Gloria Martins 17 -
-1
votes1
answer67
viewsHow to bring in Razor a Dropdown with the element already selected from a database?
I created a register where an object has n elements and each of them is selected from a Dropdown, the registration works perfectly but when I edit the Dropdowns do not show the selected item…
-
-1
votes1
answer54
viewsSelect specific column of file . MDB in C#
I need to use data from a specific column in a file .MDB. I can read the file, but it only shows me first column, I tried to change the SELECT, changing the * by column name, but it didn’t work out…
-
-1
votes1
answer40
viewsError 400 when sending a Javascript Buffer Array to a C#Action
After receiving a CSV file and reading it with the JS Filereader, I need to send the return of this reading to an Action of a C#Controller. However when sending, I get an error 400. I would like to…
-
-1
votes1
answer41
viewsCondition with Click
I’m doing a quiz with 4 answers/buttons,and with items, which are only activated if they are clicked,one of them works like this:If you want to use it you have to activate it before you answer,the…
-
-1
votes1
answer166
viewsAsp.net core User Authentication and Authorization
Hello, I have the following conceptual and architectural problem of an application. -Scenario: There is an application that has user table, user permissions and user groups already defined in the…
-
-1
votes1
answer90
viewsDatagridview - remove button
Good morning. I need help to solve the following problem: I need to do a project in which I insert a code and name of a person to be stored in a datagridview (windows Forms c#), but when I use the…
-
-1
votes1
answer80
viewsIronpython.Runtime.Exceptions.Importaxception: 'No module named fcntl' - Ironpython C#
Hello, good afternoon, sir. I am calling a file . py, which is in the scope of my application directory, and the following error is returned: Ironpython.Runtime.Exceptions.Importaxception: 'No…
-
-1
votes1
answer138
viewsSave information list in txt MVC
Good afternoon guys, as I am new in mvc would like a help if possible from you, I am trying to get some data from my list add the same in a txt file and save on my machine, what this agreeing is…
-
-1
votes1
answer37
viewsin my code when I search for pre-inserted variables it shows the variable more than once
for some reason as soon as I search for a variable in the code it lists the variable only that more than once based on the Count variable, int x=0; int count=0; string[] item = new string[500];…
-
-1
votes2
answers31
viewsCode problem probably coming from Sqlserver
I’m trying to create a very simple login system, I’m new to programming and I’m still learning and I came across a mistake, The compiler does not present any errors however when running and trying…
-
-1
votes1
answer53
viewsGetall Error: Calling Shapedqueryexpression.Visitchildren is not allowed
DETAILS I am using . NET Core 3.1 and Mysql 8.0 I’m starting a new project using a Mysql database on Digital Ocean. I’m using the DDD, I used as a basis to make the structure this website. I created…
c#asked 4 years, 7 months ago LeoHenrique 954 -
-1
votes1
answer43
viewsProblem in xml deserialization
I am trying to convert the following xml into object But it returns the empty categories Code: Records records = new Records(); XmlSerializer serializer = new XmlSerializer(typeof(Records)); records…
-
-1
votes1
answer38
viewsHow can I present in minutes:seconds the value of a Tooltip that is given in seconds?
The value of the Y series is given in seconds, but I need to present in the tooltip in minutes:seconds. Example: Value in seconds= 320. Value to be displayed in tooltip= 05:20. I made a script to…
-
-1
votes1
answer22
viewsDropdownlist Scading - Does not load the second dropdownlist
good night!!! I’m a total newbie on this Asp.net and I’d like some help from you guys. I got an example on the Internet of a waterfall dropdownlist. However, when I implemented it in my application…
-
-1
votes1
answer250
viewsSearch log by Cpf ASP . NET CORE 3.0
I created a simple CRUD using ASP . NET CORE 3.0 using EF. All basic CRUD operations are running normal. I tried to create a method manually to search a record by the client’s CPF as code below, but…
-
-1
votes1
answer187
viewsHow not to break the page on iTextSharp split my table into two pages
I would like to have my pdf put on the next sheet the table that did not have enough space in the last and did not divide this table in the two sheets. if (reader.HasRows) { while (reader.Read()) {…
-
-1
votes1
answer142
viewsError saving Decimal value with . Net Core and Mysql
In my project I have a field Valor of decimal type, as I set up the culture for en in my project I need to send the value with the tab ",". If I define the input as text does not accept sending with…
-
-1
votes1
answer194
viewsC# Double Type Precision Loss
Hello! I wrote a program in C# that converts the decimal separator from a comma string to a dot. For this, I used the Replace() method. The problem occurs when I try to convert the number (now with…
-
-1
votes1
answer89
viewsCreate an expired date alert on a Gridview in ASP.NET in C#
I am doing a final project, where a record of task, description and date is made. But I am unable to put a warning/alert/message on the screen to warn the user that a task is expiring. I am…
-
-1
votes1
answer106
viewsHow to duplicate or clone a DIV in Java Script and read all elements in ASP.NET C#
Hello, I have a guest form that I need to automatically increase the fields according to the completion. The code is: <div class="form-row" id="Guests"> <p><strong>Guests…
-
-1
votes1
answer481
viewsHow to return data in JSON format from a Webapi . net
I’m making a call inside the API to return consumer data, but I would like to know how to return this data to the client in JSON format. My controller: [System.Web.Http.HttpGet] public async…
-
-1
votes1
answer37
viewsC# Lambda for Java Lambda
I have this code in C#. A lambda expression that searches for files in a directory using regex and plays those files in a function by running a command line. All found files are added in "Task" to…
-
-1
votes1
answer97
viewsC# Click and drag or use mouse scroll (Postmessage/Sendmessage)
I’m creating a console application, I need to scroll a certain part of the window from positions (x=350 y=240) to (x=350 y=120) (vertical scrolling), tried in several ways but could not. I also…
-
-1
votes1
answer56
viewsReturn data from a query without certain fields
Good morning, I made a query that returns only completed data between a given period, I only need these two data but entityframework is demanding some fields that I do not need as ID. Is there any…
-
-1
votes2
answers51
viewsHow to pick a Function From a string
I would like to make a system that when informed an integer number (Int) it performs a certain function. Int Input > Find Object Function > Transform int in a name > executes the function…
-
-1
votes1
answer38
viewsThread problem in Backgroundworker
I’m learning how to use Backgroundworker now and I’m having this problem to access the information of some chekbox on Mainwindow, I’ve been researching about Dispatcher but I can’t quite understand…
-
-1
votes2
answers20
viewsView values submit to controller with post
I am quite beginner in MVC and was here as a question: In view I have: <form id="form1" action="/Jogo/ExecutarAcao" method="post"> <input type="radio" id="banana" name="opcao"…
-
-1
votes2
answers84
viewsrepetition cycle For chained, in C # Sharp, initiation
Hello, good afternoon can someone fix the program for me to be right? The goal is the program in c Harp writes is ready to receive retirement, if you have more than 60 years and more than 30 years…
-
-1
votes1
answer82
viewsIs the math going wrong? C##
Hello I am very confused now I took the formula to take the distance between 2 points and applied in my application but this giving result different from the calculator text code: public static…
-
-1
votes1
answer48
viewsMultiple Select Sum with related table parameters
I tried to make a Subselect query when a user wants to search the Asset by Product, by Location and by Situation the Total of the sum is changed. And it only adds the Asset to that = true. Follow…
-
-1
votes1
answer25
viewsInternal Server Error Importing ASP.NET Project in Visual Studio Code 2019
Hello, I’m a beginner in ASP.Net MVC and I’ve been trying to open a project in Visual Studio 2019 that I was sent zipped via Dropbox. When I Build the Project no Build error appears, but the problem…
-
-1
votes1
answer48
viewsQuery Problem C#/Postgres
I have the following method: private static List<ProdutosTmpModel> GetInListaPromo_caddespd(Dados dados, Empresa emp) { //busca todas os produtos das listas vigentes StringBuilder command1 =…
-
-1
votes1
answer230
viewshow to decrease the response time of a Web API?
I’m a beginner in C# and I’m developing a CRUD using Angular and Web Api (Entity Framework Core), but the response time to list my Serverscontroller data in my table is very high. What happens…
-
-1
votes1
answer32
viewsHow to start a download automatically when the user enters a specific page
I have a MVC C#application, where after login (it will be the first time you access the platform) the system starts downloading some files (the files change according to the needs of the department,…
-
-1
votes1
answer22
viewsHelp with Daysofweek method in Asp . net
I am one creating an api using Asp.Net that performs task listings and these tasks are displayed per day, week, month and year, my doubt is on how to perform this call only for the current week that…
-
-1
votes1
answer36
viewsInsert multiple values with WEB API
How are you, my dear? Quiet? I will summarize my project to assist in understanding: I am creating a CRUD to assist me in some of the company’s tasks. I have 3 areas I use (System, Database and…
-
-1
votes1
answer28
viewsI’m facing a problem with Datareader, in the C#programming language, Visual Studio development environment
Hello, all right? I am facing problems with Data Reader, what happens -> I have several forms/Forms, and when trying to enter one of them, in this case, the Sets form, the message appears "There…
-
-1
votes1
answer166
viewsProblem raising API and making request via Postman
I’m creating an API project in dotnet core and I’m not being able to perform requests via postaman on it. Urls of attempts: "http://localhost:5050 e http://0.0.0.0:5050" "https://localhost:5001 e…