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
answer1524
viewsPassing data to another page
I need your help, I have two forms, Form 1 Form 2 in the Formulario 1 i have a date field, when filling out this date field I want it to copy to the Formulario 2 without me having to type, it is…
-
-1
votes2
answers79
viewsWhen selecting a certain value in the combobox, insert values in another
I would like to enter values in combobox 2 depending on the choice in combobox 2. I have this code but it does not work or insert the desired values in the combobox 2. private void…
-
-1
votes2
answers102
viewsBitdefender false positive when compiling using Debug Visual Studio 2019 mode
I have an application that I tried in C# to use Confuserex to try to make decompilation a little difficult, but now Bitdefender recognizes it as a Trojan, no matter what I do, change namespace…
-
-1
votes1
answer311
viewsDatetime null 01/01/0001 - Error in selection (Winforms+Layers bll,dal,model) C#
I made a business rule where I pass some information from my service order to my cashier. However when I will perform the search in the box, my date passes 01/01/0001, and the error of characters.…
-
-1
votes1
answer236
viewsCOM serial port
I’m trying to execute a code every time, where it takes the value sent by the COM port of the Arduino, prints in a textbox and soon after generates an Insert in the mysql database. Only that he read…
-
-1
votes1
answer69
viewsApp Xamarin showing an hour in advance
Here in the company we have an application to beat point, in this application is shown the current time on the screen. Ex: viewModel.HoraAtual = DateTime.Now.ToString("HH:mm:ss"); It is always…
-
-1
votes1
answer49
viewsWhat is the best way to search for many variables in the database?
I am developing a C# MVC application and am having problems presenting the records. I have a list of over 250 variables and the user chooses which one he wants to see on the chart. Inside the…
-
-1
votes1
answer233
viewsHow to send the admin password to windows cmd
I have the code below in . Net written in Visual Studio 2019, which activates windows. The problem is that when running windows propmpt command running with an AD admin account it asks for the…
-
-1
votes1
answer93
viewsAccess denied to directory
Hello, I have a small project that is working perfectly. After finishing programming I generated an installer using the Microsoft Visual Studio Installer Project. The project installs correctly but…
-
-1
votes2
answers74
viewsView.Bag returning null
I am creating an APS.NET CORE form with C# and Sqlserver sending email and one of the fields is a dropdownlist that lists data from a table. List<Templates> templates = new…
-
-1
votes1
answer815
viewsHow to make a POST with "Multipart/form-data" using C# in Console applications?
I’m trying to do it like this and it’s not working: var content = new MultipartFormDataContent(); httpClient.BaseAddress = new Uri(urlFinal); var fileContent = new…
-
-1
votes1
answer99
viewsFind widget from code
I have a table with several lines and in a column x I have a href containing what I need to click, but in this href only a gif is placed and so I can not capture by Partiallinktext. Is there any way…
-
-1
votes1
answer424
viewsReturn Controller Image and Render to an HTML Tag Using Javascript/Jquery
I need to render an image returned from a controller to display it to users. I believe that this my code, is very close to the final result, but I can not achieve this final result, always is…
-
-1
votes1
answer42
viewsHow to apply recursive functions?
Create a program in c# that allows using a recursive function, to determine the number of times the letter B appears in a word entered by the user.
c#asked 4 years, 9 months ago Manzambi Bambi Konde 9 -
-1
votes1
answer57
viewsScript in c# that reads characters and Replace characters
A Program in c# that reads a string string, and prints it on the console in such a way that the vowels are replaced,.
c#asked 4 years, 9 months ago Manzambi Bambi Konde 9 -
-1
votes1
answer36
viewsReference problem
I am studying . net-core and am trying to make a system for a hospital using standard DDD and . net-core. Just when I started creating my templates and views, I came across a reference problem when…
-
-1
votes1
answer39
viewsI’m having trouble removing accents in the string
I need to remove accents from the string. I need to take to convert URL in BD. From to > the
c#asked 4 years, 9 months ago Pedro Ruivo 9 -
-1
votes1
answer97
viewsError saving form data to DB with c#
Is my registration logic correct? Because I am not able to save the fields in the Database, follows below the button code: private void cmdSalvarGuiche_Click_1(object sender, EventArgs e) { if…
-
-1
votes1
answer68
viewsDesktop C# Mobile Comparison
I am a young man in the world of programming, the language I decided to learn was C#, and I did well to learn. These days a friend of mine gave me a good idea for a mobile app during a conversation…
-
-1
votes2
answers312
viewsSelenium sendkey sending unspecified text in the textbox - C#
When using the Sendkeys function in Selenium, the value sent to the textbox is dropped. This happens for both Chrome and Firefox. Ex.: I’m sending the value 123456789 to the textbox field and it’s…
-
-1
votes3
answers134
viewsHow to open only one form even by multiple clicking C#
Good afternoon, I’m doing a quiz on Windows Form,: Async void Proximo() { await Task.Delay(100); this.Close(); Form2 form = new Form2; form.Show(); } private void button1_Click(object sender ,…
-
-1
votes1
answer63
viewsException when querying using DTO in EF . core
I get the following error when executing the query: "Cannot create a DbSet for 'Cliente_dto' because this type is not included in the model for the context." public IQueryable<TEntity>…
-
-1
votes2
answers386
viewsGet Boolean Value Gridview Column
I have a GridView filling correctly, but I need to take the value of column 5, which is of type BIT in the database (SQL Server). In every way I try, informs error, I tried to pass to a variable of…
-
-1
votes1
answer54
viewsWhat Process.Getcurrentprocess(). Kill(); does?
I’m making a program, in it I have to stop the execution of a screen with a condition. I found a way to do it here on the Internet, but I don’t want to just copy, I want to understand! Follows the…
-
-1
votes1
answer538
viewsPassing data field parameters
I have a problem until simple to solve, but since I am new in C# I am not getting the solution. I have two form, form 1 I have of txtBox I put the initial date and final date, and this form 1 I have…
c#asked 7 years, 7 months ago Junior Guerreiro 617 -
-1
votes1
answer108
viewsHow to get specific information from Tolistasync
I would like to create a system that prints on the Index page each Post equal to the image below And for this I created a method that searches the last 3 posts, however, I do not know how to print…
-
-1
votes1
answer67
viewsC# - Algorithms - For loop - Logic - Using previous value of a variable and current value of another variable
DOTNET FIDDLE Editing The following calculations correspond to actuarial calculation variables. The ages from "present age" to the age of 120 years run through the probabilities of a person’s death…
-
-1
votes1
answer81
viewsMeaning of signs in C#
What are the signs < >, [ ], { }, ( ) playing games in Unity?
-
-1
votes2
answers92
viewsChekbox with filters
I have a stock query in C# that generates a report with reportviewer. I have a Checkbox that when I click on it it does not show me the items with zero balance and when I uncheck it shows the items…
c#asked 7 years, 7 months ago Junior Guerreiro 617 -
-1
votes1
answer65
viewsWhat is the main difference between Kafk, Rabbitmq and Digibee?
I’m working on medium-sized project, and I arrived in a moment that I need to use a messaging system to make the shipment information to a third party system. I wouldn’t want to use a cannon to kill…
-
-1
votes2
answers75
viewsHow to serialize or deserialize a json with lowercase keys and uppercase values (newtonsoft)
I have the following JSON string example: : { myproperty : 'Hello' } When I desiccate you or serialize you, I want you to stay that way: { myproperty : 'HELLO' } All values in Uppercase and All Keys…
-
-1
votes2
answers357
viewsWhat is the difference between override and :base in C#
Good afternoon, I’d like to know the difference between override and :base in C# Is there any difference or has the same function?
-
-1
votes1
answer62
viewsString to Json data conversion for Collections in mongodb
When I query a Collection in mongodb, it returns a field of the string type. [{"id":"1325","nome":produto1,"estoque":"10"}] But I need to make this field a Json. It is possible to do this in the…
-
-1
votes1
answer29
viewsLimit the number of characters in a textbox
Hello, I am trying to "create" a system of "captcha" for my program, but it sometimes exceeds the limit of the textbox, and in this case the user would not know what comes next, I researched a lot,…
-
-1
votes1
answer54
viewsHTML5 datepicker onchange event
Can anyone tell me how to use datepicker onchange event to do a check on selected date? in my cshtml is like this: @Html.EditorFor(model => model.Dat_emissao, "{0:dd/MM/yyyy}", new {…
-
-1
votes1
answer24
viewsDo dates search using MVC5
Good afternoon, guys, okay? I hope so. I’m having doubts about ordering the database data in ascending order of dates. var result = from r in context.name Where r.numero == 2 orderby r.datacadastro…
-
-1
votes1
answer69
viewsNumber lines in Datagridview in C#
I have a DataGridView and a method to fill it: public DataTable BuscarClientesEmAtividade() { OleDbDataAdapter da; DataTable dt = new DataTable(); OleDbConnection con = ConexaoBanco(); OleDbCommand…
c#asked 4 years, 2 months ago Carlos Eduardo Godinho 1 -
-1
votes1
answer208
viewsWrite to BD without mask applied by jQuery
I am doing a project in MVC and with the use of jQuery I made CPF mask as below: $(document).ready(function() { $(".cpf").mask("999.999.999-99"); $(".cpf").addClass("form-control"); }); Follow my…
-
-1
votes1
answer133
viewsHow to make a macro that clicks in several places?
Hi, I’d like to know how to make one. exe that acts as a macro, whenever I press the ALT key it will perform mouse clicks at a certain position with shift pressed at the same time. It can be in any…
-
-1
votes1
answer42
viewshow to use Dictionary select . value concepts
what that select and . value means var idProdutosDistintos = DictionaryVendas .Select(x => x.Value.Produto.Codigo) .Distinct() .Count(); sw.WriteLine("E - " + idProdutosDistintos);…
-
-1
votes3
answers176
viewsTooltip in a Listview in c#
I have a ListView with several CheckBox created through the database. Wanted to CheckBox as I passed the mouse over, I opened a tooltip with various information from that field. I’ve tried to do it…
-
-1
votes1
answer26
viewsHow to change Combobox value according to case
The combobox has two options the Letter option and numbers option. When I set one, I need it to appear in another comboBox only the information corresponding to the selected option. The comboBox is…
c#asked 3 years, 10 months ago Rogerio Claro 9 -
-1
votes1
answer35
viewsASP NET CORE 5 EF with DLL database-connected
It is possible to use a database connection DLL in an ASP NET CORE 5 project with Entity Framework? I have a DLL named "Bancodados" as I can use the methods of this DLL in the context of the…
-
-1
votes1
answer122
viewsHow to make an error handling for search not found in ASP.NET API?
The return outside the Try-catch block returns me an empty array, but what should I put there to return some error message in the API request status? Removing Ienumerable and switching to an…
-
-1
votes1
answer40
viewsReference the class itself in the inheritance dynamically
Good morning, i have the following code in c# Asp.net-Core: public class AgentsTrans : BaseTrans<AgentsTrans> Basetrans is a generic base class that expects to receive a class as a parameter…
-
-1
votes2
answers180
viewsDownload a file in C#
Good Afternoon, I’m a beginner in C# and I’ve already looked for this answer here on the internet and I didn’t find it at all, I’m working with C# and windows Forms, I have a folder inside my…
-
-1
votes1
answer21
viewsHow to save color changes to a Datagridview line?
I need to save the color changes the user makes on the datagrid. Currently the colors are exchanged according to the user’s selection using the following code:…
-
-1
votes1
answer50
viewsC# Lambda function with multiple validations, checking using contains with multiple comparisons
_release is a List with several records x.located is a bool x.Description is a string I’m trying this way if (_lancamento.Where(x => x.Localizado && x.descricao.Contains(new…
-
-1
votes3
answers90
views(C#) How can I replace a specific character "x" with "y" in a String?
To want to make a function that can replace a value in character( "@" ) with a value "A" inside the string. Assuming the input is "@@bbcc@@", then the function returns "AAbbccAA" .…
-
-1
votes1
answer33
viewsRight Button Print Html generates blank sheet - Asp.net MVC4
Guys, I have a problem where I have an html page. Right-clicking -> Print generates a blank sheet at the end. I have already reduced the html of the page to almost nothing but still generating…