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
votes0
answers92
viewsSelenium C# without suitable main method
I’m taking some automation classes with Selenium with the C# language and when I compile asks for the proper main method that I’ve tried in several ways using System; using System.Text; using…
-
0
votes2
answers61
viewsHow to update two tables
Good night! I’m having trouble updating two tables at once in C#. Obs. in this way it updates the CONTACT table, if I invert the UPDATE sequence it updates the CLIENT table, but never the two…
-
0
votes1
answer136
viewsHow to use Jquery autocomplete with C# ASP.Net?
Guys, I’m trying to use Jquery autocomplete in C# from a method that brings me a list of database clients (the database is the Northwind provided by Microsoft), but I’m getting an error that I can’t…
-
0
votes1
answer350
viewsDoes not contain a constructor that takes 0 arguments
My code is public partial class TelaInicio : MetroFramework.Forms.MetroForm { internal ExibirDados exibirdados = null; public TelaInicio(ExibirDados exibirdados) { InitializeComponent();…
-
0
votes1
answer37
viewsSearch Using Combo box
I’m with a ComboBox that when I select Active or Inactive status it empties my DataGrid What I’d like him to do is select one of the two Options and bring all records with Active Status, for an…
-
0
votes1
answer54
viewsHow to check and convert Ienumerable values from a database query?
I have one that returns a table in Ienumerable and I have a certain column that returns values "A" for Active, "C" for Canceled and so on. I would like to convert these values to the correct one…
-
0
votes1
answer163
viewsHow to check if you are registered through Monthecalendar ? C#
Talk good morning guys! I’m having a little difficulty regarding use of Monthecalendar... I have a scheduling system by DATA, which after registering the given event, it is presented in…
-
0
votes0
answers106
views -
0
votes0
answers73
viewsExport dataset in excel Asp.net
I created a program to export a Dataset to excel at runtime via Response, but when opening the file a message of incompatibility between the file format and the file extension is displayed. Follows…
-
0
votes0
answers39
viewsC# - Comparison of date with LINQ does not bring the expected result
We have an Oracle database with a View. We have to take the total harvested cane by adding the column QT_LIQUIDO according to the day. We made the code in C#, but it is with an unexpected behavior.…
-
0
votes1
answer447
viewsImplement permissions on a REST API Asp.net core 2.0
I am implementing an API in ASP.NET Core 2.0 in which I need to implement permissions, but the forms I found (Roles, Claims, Policies) left me very confused, because the permissions structure I need…
-
0
votes1
answer56
viewsError bringing a Log Data to a label
Hi, I’m trying to bring in for a Label a database registration data, for example: when the person selects the product on ComboBox the price of the product on label However, I don’t think I’m getting…
-
0
votes1
answer80
viewsAlign column to right pdfsharp
Good morning, I am using the pdfsharp library, and I want to line up the column for the value on the right. Could you help me, please? Follow the code below. graphics.DrawString(f.ENT_DAELOC, font,…
-
0
votes1
answer327
viewsHow to create a list of Roles in Claim using ASP.NET Core
I made an authentication using Claims with cookies in the ASP.NET Core. In the Method below, the object by parameter brings the login information and inside it has a list called PerfisDeAcesso. How…
-
0
votes0
answers53
viewsOperations with Bytes vector in C#
I’m new to programming and I’m working on an RSA encryption algorithm. The key generation processes, calculations are almost ready... I have an array of bytes that receives the message typed by the…
-
0
votes1
answer164
viewsHow to check if there is a Usercontrol in a Panel? C# Winforms
I’m making an application that has a central Panel, and for it I’m controlling the Usercontrols, I’m using Clear, Add and Bringtofront to manipulate, i wonder if it has any function so that I can…
-
0
votes2
answers759
viewsProblems connecting to sql server with Visual Studio and C#
I have encountered problems connecting to sql server by visual studio with Entity Framework 6. My connection worked normally and after I created a new project, I cannot access the database server.…
-
0
votes2
answers128
viewsWhich type is inherited from an . NET array?
If we declare a List, we are sure that your type is explicitly the System.Collections.Generic.List<T>. But when we declare one array? What is the generic type implemented behind it? Example:…
-
0
votes1
answer72
viewsIn which (is) layer(s) of a DDD project should I implement a Import/Export text files and reports feature
I have a C# project using the DDD + EF Core standard, based on a very good Eduardo Pires project: insert link description here I need to implement two resources: Import/Export (TXT, CSV, DOC,…
-
0
votes1
answer338
viewsPagseguro . Net Core Problem with . xml
I am implementing the payment with Pagseguro, however I am having problem in the execution of the following line: const bool isSandbox = true; EnvironmentConfiguration.ChangeEnvironment(isSandbox);…
-
0
votes1
answer104
viewsEntity Framework Mapping - Area Code
I’m starting to work on a DDD project. I happen to be having a lot of doubts, and as much as I research, it gets more and more confused. I created this classe: public class Teste { public int Id {…
-
0
votes2
answers301
viewsSELECT LAST_INSERT_ID() always returns 0
I have the following codes: public async Task EnviaMySQL<T>(string sql,bool pass = false, string file = "SqlJson.php") { if(!pass) Utils.Acoes.Load.ShowLoad(); var result = ""; var lista = new…
-
0
votes1
answer77
viewsHow to store and display time only? C# Mysql
I need to take an input time and an output two textboxs, store in the bank and later display, my code is like this: //Cadastro //No evento do botão cadastrar entradaSaida.HrEntrada =…
-
0
votes4
answers587
viewsHow to correctly send the value of a null variable in an INSERT?
Assuming I have the following code: public async void InsertBanco(string parametro1, string parametro2) { var b = new BancoN(); SetBanco(b); await b.EnviaMySQLInsert($"INSERT INTO tabela(parametro1,…
-
0
votes1
answer105
viewsusing CAST in INNER
Good morning I’m trying to make a mistake but Join. string Query = "Select rec.chvbfj, rec.doc, vndB.chvvnd, vndB.chvps, ps.chvps, ps.Dsc " + "From (( " + "rec " + "inner join vndB " + "on…
-
0
votes2
answers327
viewsReceive List in View. Asp.Net Mvc
I’m having trouble with Action Edit. I have a class called Clientefirm this class has a System collection. For Example: The Customer X uses the systems To, C and F. My problem is how to present…
-
0
votes1
answer28
viewsHow to make the correct Ipaddress.Parse conversion
Hello, I’m making a communication with an equipment using socket. I’m using the library System.Net to convert the ip and pass the port as parameter in the IPEndPoint to use in the…
-
0
votes1
answer30
viewsProblem with focus of windows
Good morning, I’m having trouble controlling focus on windows in some situations. I need to control this well for one should always block the other. I have a multi-window solution, I will use…
-
0
votes1
answer116
views -
0
votes2
answers163
viewsHow to make an ASP.NET Core Post API without using MVC?
I don’t work with ASP.NET Core Apis until I need it for a project written in C#. So I created with a standard project, with the following controller: [Route("api/[controller]")] [ApiController]…
-
0
votes0
answers38
viewsQuery with Leftjoins using Groupby Includes are not performed EF.Core C#
I need to perform a query with the Entity framework where I have an entity Offer and in it I have several Cards (Entity). In the query I am performing the card include, and using Selectmany to…
-
0
votes1
answer96
viewsWhere should I put the model classes (POCO) in a C#Solution?
Currently my Solution is organized more or less like this: View (Windows Forms) DAL (Data access, return business entities) BLL (business rules in general) Model (POCO’s representing any business…
-
0
votes1
answer31
views -
0
votes1
answer85
viewsError in Insert Entity Framekwork - Mysql
I am getting the following error while trying to perform Savechanges(): Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or…
-
0
votes1
answer54
viewsCreate a label when reading data from a file
I am trying to create a button that, using the information deposited in 3 files (labelName, Labelx, Labely), create a number of cells according to the number of entries. That is, if I have 1 entry…
-
0
votes1
answer119
viewsAdd multiple items in a single Session
That way I add an item to session var item = new FornecedorTipoFrete() { TipoFreteId = id, TipoFrete = new TipoFrete() { Descricao = tipofrete }, FornecedorId = (fornecedorID) };…
-
0
votes1
answer286
viewsHelp with Decimal . Net Core 2.2 recording
I have a system in .NET CORE 2.2 where I am facing a problem in recording decimal numbers in the database MySQL. Using as an example the decimal 19.99: By MAC writes correctly; By Windows writes…
-
0
votes1
answer200
viewsDatetime.Now Does Not Update If Time Changes
I have on application with a running timer, taking a 1000ms interval. This timer does some routines every X time, and among these routines the customer’s time is very important. we have already…
-
0
votes1
answer435
viewsSearch mongodb by text?
I want to create a search in the items I am listing, I want to filter according to what user pass in a field type google.com click search and return the results that contain that text, but I want…
-
0
votes1
answer867
viewsHow to have more than one GET request?
I want to be able to fetch my items by name and this function is also a get request only it already has other requests Get wanted to understand how to get as many as I want I understand the program…
-
0
votes1
answer85
viewsI cannot call an asynchronous method in the view
I’m trying to call this method asynchronous in the view but I can’t. private async Task LogOff() { RedirectToAction("Index", "Home"); await HttpContext.SignOutAsync(); } This is one of the ways I’m…
-
0
votes1
answer100
viewsDelete programmatically created Labels
I’m developing a mapping application that uses Abels to name the different rooms in a building. The code I use to create the Abels is as follows: private void button2_Click(object sender, EventArgs…
-
0
votes1
answer36
viewsPull data from Datagridview to a form
I got a problem where I got two forms TelaInicio and ExibirDados and I’m trying to make sure that when the user double-click on some line in the Grid will open a form pulling the information…
-
0
votes2
answers2509
viewsUnable to access a discarded object
I am instantiating a form from a double click on a Datagridview from another form, where through this return the information from that line to the form. It is working properly but when I close this…
-
0
votes1
answer51
viewsParameter Crossing in ASP.NET
I have the following code: Admin Page: private void Salvar() { Session.Add("Salvar", txtSobre.Text); try { if (txtSobre.Text != string.Empty) { Session["Salvar"] = txtSobre.Text.Trim(); } }…
-
0
votes1
answer30
viewsC# wpf Datagrid generation
I have a datagrid that is automatically generated dgPagamentos.ItemsSource = HistoricoDoClienteViewModel.ExibirPagamentosPorCliente(id); My problem is that this call returns me an object that…
-
0
votes1
answer43
viewsgetters and setters do not work with Httpget
Good afternoon guys, I have the following code: [HttpGet] public JsonResult ObterGridParceirosComPaginacao(PaginacaoVueTableViewModel filtro) { Resultado resultado = new Resultado(); var viewModel =…
-
0
votes1
answer323
viewsHow to ignore upper and lower case in the Contains method?
I have two List with some strings, for example: List<string> lista1 = new List<string>(); lista.Add("string1"); lista.Add("string2"); lista.Add("STRING3"); List<string> lista2 =…
c#asked 5 years, 6 months ago Artur Brasil 501 -
0
votes1
answer235
viewsDataannotations With Datetime
I’d like some help. Following model: [Display(Name = "Data Aquisição")] [DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = false)] public DateTime…
-
0
votes1
answer28
viewsDo I upload all the data directly into the HTML page or access the database more often?
I’m developing a web project for real estate. On the page is the mirror of sales or the floor plan of the condominium of houses to be sold. When the user clicks on one of the plant houses, the…
javascript c# html database web-applicationasked 5 years, 6 months ago Luis Fernando Martinelli Ramos 23