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
-
-2
votes1
answer134
viewsProblem with sql query in my ASP.NET core application
I’m having trouble at the time I need to query information in the database through my sql command in my Asp.Net Core application. I’ve done research here at Stackoverflow and I can’t find. Error:…
-
-2
votes1
answer54
viewsApplication for marking point!
Good afternoon guys, all right? I’m looking to develop an application here for work. Today where I work, we have corporate employees (they are among all the units of the company). And at the end of…
-
-2
votes1
answer20
viewsMy panel dont close
im Tring to makeI’m trying to make a button that closes the hack_panel but it didn’t work public class Level1_Controller : MonoBehaviour { //Variables public Button Hack; public Button Develop;…
-
-2
votes2
answers804
viewsSAVE VARBINARY IMAGE IN DATABASE
Hello, I have a windows form application, I already have a button to upload via Filedialog to my picture box, displaying it. Follows the code private void button2_Click(object sender, EventArgs e) {…
-
-2
votes1
answer70
viewsHow to Change a Data in the BD
I’m trying to change the data registered in the database, for example, when I click on DataGrid He pulls the dice for me textBoxs, but I wish I could save the changes made, but it does not change,…
-
-2
votes1
answer128
viewsSelect days comparison with current date does not work
I have this select which brings back the data as follows, if DataCobranca for 10, and today is day 05, it will pick up all customers that is day 10, as it will be generated 5 days before, or case…
-
-2
votes1
answer157
viewsHow to Configure a string Connection
I am wanting to connect to the database but my string Connection is not starting. Error: https://prnt.sc/ngeqde Class Startup: var connectionString =…
-
-2
votes1
answer147
viewscontroller with the same name (home) in different areas
I have problem of ambiguity, when having controllers, with the same name as, Homecontroller in two areas: Admin and Backoffice is me presenting the problem of ambiguity, I’ve searched enough subject…
-
-2
votes2
answers65
viewsI’m trying to do a research boot on my view, but tell me it can’t be null
I’m trying to make a search button on mine view of films, but gives me a mistake to say that I can’t have a zero value. Why? And what do I have to do? Controller: public ActionResult Index(string…
-
-2
votes1
answer432
viewsConsultation Group by Linq
It would be possible to consult the table below in a single query? It would be a group by query using Context with Entity Framework where: The 3 customers who spent the most on services per month in…
-
-2
votes1
answer178
viewsHow to drilldown to the customer data sheet and to the Article sheet (V10)?
I am trying to do the drilldown for a maintenance in the spring, for example the customer’s file or article but I do not understand how to do. In version 9 I believe that the method will be…
c#asked 5 years, 5 months ago Bruno Adão 1 -
-2
votes1
answer77
viewsCan anyone help me with this json error in c#
Newtonsoft.Json.Jsonserializationexception: 'Not possible deserialize the current JSON matrix (e.g., [1,2,3]) in type' Json.Pulse 'because the type requires a JSON object (e.g., {"name": "value"})…
c#asked 5 years, 4 months ago Guilherme Willahelm 1 -
-2
votes2
answers306
viewsNo Overload for Matches delegate error on a C#
I am programming a button that checks if the login is existing and advances to another screen but appears the following error: "no Overload for 'btnEntrar_Click' Matches delegate 'Eventhandler'"…
-
-2
votes1
answer227
viewsSearch the database and move to a listview c# Windows Forms
I am developing a project and for being new in the area I am with enough doubts and difficulties. My problem is the following: I have a form to manage a company’s forward notes, when opening the…
-
-2
votes1
answer900
viewsError: No support for keyword: 'Provider'
I have to maintain a system and it is with a problem that I can not solve for 1 month because of a connection failure. There is no support for the keyword: 'Provider'. Description: An untreated…
-
-2
votes1
answer43
viewsQuery that searches quantity of items from a column in a table with the same name
Hello, I’m trying to find the amount of records with the same name, from a certain column in my Lead table in the database in a period (month). Follow my class, I want to search only from the field…
-
-2
votes1
answer42
viewsC program working but not continuing, gives error at the end
This is a program that I’ve been doing for presentation only that part of it is making mistakes that I haven’t been able to solve. Here is the . h: #ifndef PROJETOIAPG_PROJETO_H #define…
-
-2
votes1
answer32
viewsError comparing database data with empty form field
I need to check if there is already a registered document number not to repeat it. However, the field Document allows null, so there is an error when comparing a database value with a null value of…
-
-2
votes1
answer104
viewsList within a Dictionary
I have a method that receives a list of products, goes through this list and needs to return n lists of products separated by CNAE. I’m trying to come back as a dictionary, but then the doubt hits.…
-
-2
votes1
answer35
viewsCan anyone tell me if there is an easier or more correct way to call two selects from different tables?
using BRQ_Jobs.Modelo; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using…
c#asked 4 years, 10 months ago Arthur Nunes 1 -
-2
votes1
answer34
viewsquery with c# and xml
Hello, I’m trying to do a c# query using xml but this gives me an error. someone could help me? code: private void button1_Click(object sender, EventArgs e) { XDocument doc =…
-
-2
votes1
answer112
viewsc# - How to close a specific instance of internet explorer?
I can with this code. foreach (Process p in Process.GetProcessesByName("explorer")) {p.Kill();} But I need to close just one instance taking maybe by the window title. This is the window that needs…
-
-2
votes1
answer194
viewsI have a return in Json and I want to get the data in C# (CNPJ Data)
I have a link that I pass the CNPJ (https://www.receitaws.com.br/v1/cnpj/@cnpj) and it returns me a json with all the information, what is my doubt, how do I take this information as Social Reason,…
-
-2
votes1
answer137
viewsCheck if the selected line is the penultimate of datagridview
I have a dataGridView on the screen and need that when the penultimate record is selected, I send the selection to the next line of the grid, which in case would be the last. Summary of the problem:…
-
-2
votes2
answers143
viewsInstantiating a class as being property of another class
I have the classes: using System; namespace Model { public class Profissionais { public int idProfissional { get; set; } public String Nome { get; set; } public String CPF { get; set; } public…
-
-2
votes1
answer80
viewsHow to format excel cells through excel
I would like to know how I can format the cells of a spreadsheet by C#, already managed to insert the data I would like in it, but I would like to insert formatting and formulas as well. Code: ` int…
-
-2
votes1
answer72
viewsHow can I improve/simplify my structure?
We have these various ifs and I wonder if there’s a way to simplify them, make them more objective, easy to understand, ... Basically, we make a where of retorno to filter that list. In that where,…
-
-2
votes1
answer151
viewsFill inputs as option selection
Hello! I have this View where I update the value and quantity of a product in the Database by selecting it in Viewbag, works perfectly. I populate this Viewbag as follows in Controller:…
-
-2
votes1
answer29
viewsI need to show all day sales MVC C#
Through an input the user enters the date and so list all the respective products of that day public void Buscar(Lancamento lancamento) { string sql = string.Format("SELECT DataHora FROM…
-
-2
votes2
answers365
viewsHow to check for spaces before, in the middle and at the end of a string using Regex in C#?
I need to check with regex so that only letters and numbers are allowed. The other characters such as ,.-*&%$#@; among others cannot be accepted. In the regex below, I’m able to validate it! I’m…
-
-2
votes1
answer108
viewsObject cannot be converted from Dbnull to other types = Entity Framework Core to Firebird
I have the following table that has the fields(ID, numeronota, clienteID, dataemissao, totalnota, desconto, troco). In this table there are fields that is null, example the change and discount, I’m…
c#asked 4 years, 2 months ago João Neto Relampago Reis 1 -
-2
votes1
answer44
viewsError running Nunit test routine by command prompt
The following error is shown when executing the command: NUnit.Engine.NUnitEngineException : The path specified in --result TestResult.xml could not be written to ---->…
-
-2
votes1
answer47
viewsWriteprocessmemory does not write data
Hello! I am trying to write data in INT type memory, and it is not working, Readprocessmemory worked normally! But the Writeprocessmemory does not. I don’t know if I’m doing anything wrong more if…
-
-2
votes1
answer36
viewsIs it possible to insert two results in the same Dropdownlist? C#
In my code, there is a page for sales registration where it is necessary to enter some information as for example which customer made the purchase. Controller Venda: // GET: Vendas/Create…
-
-2
votes1
answer30
viewsI need help because I don’t understand why my code isn’t performing date filtering. ASP.NET [Solved]
When I do the filtering, no value is returned to me my view index page I think the problem is in my Actionresult index, but I don’t know what it is, because I think the references are correct. What…
-
-2
votes1
answer37
viewsUpdate Textbox data on different . ascx components, but on the same page . aspx
Once again in need of your help! Next, I have a page CadastroProposta.aspx, 2 custom components are loaded inside this page, DadosPagamento.ascx and DadosCobranca.ascx. In the component…
-
-2
votes1
answer180
viewsC# Generate random and unique number, check the database if any equal number has already been generated and if you have to generate another number again
I’m developing a system where I need to generate one random number and single and write to the bank, this system will run every day generating new numbers based on business rules. With the help of…
-
-2
votes1
answer42
viewsTrying a CRUD with Asp.Net Core 3.1 and gives error in connection with Sql Server
This is my connection string "ConnectionStrings": { "bdcoreconn": "Server=.\\SQLEXPRESS;Database=BdCoreCrud;Trusted_Connection=False;MultipleActiveResultSets=true;User Id=sa;Password=Simb@d123;" },…
-
-2
votes1
answer80
viewsCapture keystrokes even if pressed outside the app
good morning I did a little program where it shows the typed key, it’s pretty simple , just so I can learn how to use Windows form application. My goal was that when running another app , for…
-
-2
votes2
answers57
viewsHow to make two queries using the same Mysqlconnection?
I have the following code snippet: using(MySqlConnection conn = new MySqlConnection(conexao)){ try { string consulta = "SELECT * FROM tb_Cliente WHERE ID_Cliente IN ("+listaClientes+")";…
-
-2
votes1
answer66
viewsStack overflow exception being generated in the instance method "Equals()"
I created a class called MyList<T>, with the intention of reproducing the class List, and I overwrote the method Equals to compare your instance with another of the same class, as follows:…
-
-2
votes1
answer51
viewsHow to read a spreadsheet with formulas
I wonder if anyone has ever faced that question. I have a code that normally reads data from a spreadsheet, but the tab I need to read has formulas and presents an error. I am using Epplus when I…
-
-2
votes1
answer43
viewsHow to do multiple Where validations with Linq and Mongo in c#
I am developing an Api and in my GET method can be passed word to be searched, start date and end date. However all fields are optional, that is, I can pass only the word without date, I can pass…
-
-2
votes1
answer40
viewsAngular does not display API data
I’m building an . net core API using c# with visual studio 2019. the entities are publisher and book and testing via Swagger and Postman, the CRUD of both is working perfectly. However, I started…
-
-2
votes1
answer23
viewsData does not appear in Datagridview C#
I have Datagridview in two forms of my project, but only appear the data in one, and the other is not appearing, I’ve reviewed everything but it seems all right for me. Form Load Code private void…
-
-2
votes1
answer80
viewsTextbox with preset value, but also editable in c#
I have an application of calculations, and I have the following situations: In a textbox I have a preset value in the codes to perform a calculation with another form that I type the value, for…
-
-2
votes1
answer74
viewsC# - Clear all form fields at once
I have a form with several Textbox, Combobox, Radiobutton. And I would like to clear all fields at once. I’ve seen a lot of forums, but I haven’t found what could be my mistake. When I compile it…
-
-2
votes1
answer44
viewsRelationship ASP.NET
Good afternoon I have a question about a relationship. i have 2 classes: Internal Person and Unit. i have the following properties in Internal Person: Personal internal belongs to a single unit, but…
-
-2
votes1
answer56
viewsCreate and use DLL libraries written in C++ on . NET C#
Because of the fact. NET is reversible, I need to encode part of my program in C++, but I still need Windows Forms, so I thought I’d create Dlls written in C++ to perform some key tasks (like…
-
-2
votes1
answer50
viewsCan you convert an array of strings to a double array without concatenating the decimal numbers in the conversion?
I would like that, somehow, after converting the string array to double, the values remain floating point. I put the input as, for example, 5.5 6.5 7.8 2.5 6.2, and during the conversion is not…