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
answer92
views -
-1
votes2
answers306
viewsFind time within a range of hours
I am trying to develop a logic where there will be any schedule I need to find within a range of hours (Start time and End time) But I can’t make the correct comparison and/or I’m not treating it…
c#asked 5 years, 4 months ago Igor Carreiro 1,917 -
-1
votes1
answer42
viewsHow to get the amount of multiple properties on a list?
I have a list that has over 10,000 Curriculum Grades. Within Curriculum Grade I have the name of the Discipline and the Teaching that it is There are 15 subjects that can be repeated for each…
-
-1
votes1
answer192
viewsdate in javascript wrong format for controller c# (Asp net mvc)
I’m in a strange situation. I am working with datepicker jquery, asp net mvc 5. i configured the datepicker for the format as below: $(".datepicker").datepicker({ autoclose: true, buttonImageOnly:…
-
-1
votes1
answer588
viewsDatareader Error Data is Null
Good night! I am deadlocked in bringing data from a Datareader with Null values. It simply does not let bring the results. I wanted it to even contain null values, so users can update in the…
-
-1
votes2
answers442
viewsHelp with MVC Pick up checkbox value and send to bool variable controller
I’m trying to send the value of checkboxwith id, if the checkbox be it true, will create the column. VIEW <div class="checkbox dadospessoais"> <label> <input class="dadospessoais"…
-
-1
votes1
answer153
viewsEncrypt String C#
I have the code below that decrypts an example X value (|xB779A:6AA6=@6::@7 and would look like http://seusite.com) however I do not know how to do the reverse, I wanted to make an application that…
c#asked 5 years, 4 months ago Rodrigo Pretti Fantin 59 -
-1
votes1
answer47
viewshttpclient is not downloading the whole html page body
When I try to get the page down "https://soundcloud.com/mecaaaa" she doesn’t lower the whole body of the body, so I can’t do what I’m aiming for. Code I’m using to retrieve page data. public string…
-
-1
votes2
answers1499
viewsBingo booklet in c
I was solving a college exercise on matrices and I ended up crashing. Ex: Build a program to automatically generate numbers between 0 and 99 from a bingo card. Knowing that each card should contain…
-
-1
votes1
answer32
viewsC# File path on other machines
I created a program that opens some powerpoit files. However I came across a question. Excerpt from the code: private void FitaBackupToolStripMenuItem_Click(object sender, EventArgs e) {…
-
-1
votes2
answers212
viewsC# How to make a string function execute active command?
I’m developing a C# project and I’m stuck in a mistake when it comes to moving from one form to another. The main form is called Main and the new Form1... well... I can send a variable string to…
-
-1
votes1
answer472
viewsRead fields in CSV format with C#
Boas, I am currently developing an app (console app) to read data from a file in CSV format using C#. Right now I’m able to run all the fields without any kind of problem and show all the data.…
-
-1
votes1
answer80
viewsError while trying to compress folders from a drive - Unauthorizedaccessexception
I need to compress all of my E folders: But when I try with this code, I get this access exception. I’m new to programming and I’m trying to learn how to do things right. I am using dotnetzip to…
-
-1
votes1
answer151
viewsConection String from Visual Studio
I have a C# Asp Net application with MVC in a SQL SERVER database on the Kinghost access provider, but I can’t get the application to connect to the KH database, gives a Windows error, someone could…
c#asked 5 years, 3 months ago André Milani 29 -
-1
votes1
answer30
viewsShow Simulation Result on another page
I have a form that receives data from the client interested in acquiring a loan, when he clicks on simulating the program does the simulation and records in the database, until then it works well.…
-
-1
votes1
answer45
viewsDecode does not work
I’m using the htmlagilitypack, where a url extraction is done inside a div, the problem is that it is not correctly bringing the encoding. Request from. net: string requisita = new…
-
-1
votes1
answer214
viewsHow to use Streamreader to read the.txt file and insert the data into a List?
I created a program that performs CRUD , whenever I create, update or delete an employee it updates the Txt file using Streamwriter, when starting the program I am trying to read that same file and…
-
-1
votes2
answers700
viewsLine break in CSV file causes error during import
The application needs to read a . csv file that is automatically generated by an external application (We have no control over this). The file . csv has 60 "columns" (after reading and separation of…
-
-1
votes1
answer208
viewsC# ASP.NET mvc URL encryption
The q method I’m using to encrypt the URL is working, but sometimes it does the encryption with a / in the middle that makes it not find the desired route. public static string…
-
-1
votes1
answer134
viewsHow can I delete a line from a Session?
I have a NO DATABASE ENTERED page, the registration data is being stored in Session. I am using a Reset to store this. The delete command that I used before was through Reset, which is wrong because…
-
-1
votes1
answer44
views -
-1
votes1
answer112
viewsError "Eventhandler with correct Signature not found"
I have the main page and Contentpage inside the Views folder. Content is successfully loaded. <Tab Title="Entrar In" Icon="enter.png"> <ShellContent ContentTemplate="{DataTemplate…
-
-1
votes1
answer45
viewsUndefined object reference for an object instance when calling dll class
I am trying to call a function of a class that is in a DLL. But the error "Undefined object reference to an instance of an object" is showing, I don’t understand why because the IDE shows no error.…
c#asked 5 years, 2 months ago Kleber Santos 29 -
-1
votes1
answer372
viewsUser.Identity.Isauthenticated always returns false
I am implementing stunning and authentication with Identity using the concept of Claims, after I login, I am not able to save the authorization, the login returns 200 ok, but is not authorized…
-
-1
votes1
answer245
viewsEngine opening time Spring v.10
Having puzzled the opening time of the V10 Spring engine in the extensibility solutions we developed (6 to 10 seconds, depending on the machine), I performed a debug log where I detected that by…
-
-1
votes1
answer173
viewsRender css/js inside a second Partialview
Using C# MVC5 I have the file "_Layout.cshtml" which loads the standard scripts and css. Each page on my site (Partialviews) then has sections (Script.Render and Style.Render) to load some separate…
-
-1
votes1
answer274
viewsLogin MYSQL in C#
I am a beginner in C#, I am trying to validate a user in a login form, but my code does not compare the result of SQL, allowing the access of the program without having the user and password…
-
-1
votes1
answer102
viewsCircle area application: method shows that not all code paths return value
I have a code that performs the calculation of the area of the circle on three insatiated objects in AppCírculo, only that the method getArea() that should return the area of the circle with the…
-
-1
votes1
answer77
viewsInvalid n Index for this Oracleparametercollection with Count=n
I’m racking my brain trying to figure out why I was wrong. Mapping of my table: <class name="AtaReuniao" table="EPN.ATA_REUNIAO" lazy="true" where=" ARUN_IN_EXCLUIDO = 'N' "> <id name="Id"…
-
-1
votes1
answer119
viewsError while sending email
I’m having a boring mistake, I can’t fix it a few days ago. I searched, but I couldn’t find anything on how to remove it. Error: The SMTP server requires a secure connection or the client was not…
-
-1
votes1
answer95
viewsHow to pass a default parameter value within a foreach in C#?
Dear friends, How could I pass a default parameter value within a foreach? Example, inside my foreach I have an if that makes a certain comparison with an attribute of my class right?. But by…
-
-1
votes1
answer71
viewsUnity revolution counter
I’m studying the game Flippy Knife, and I used Addrelativetorque to turn the knife and apply the 360 that always adds 1 point, but when trying to count the score checking if the knife has reached a…
-
-1
votes1
answer164
viewsHtml Agility Pack C#
I’d like to know how the // in the Html Agility Pack. Well, the doubt is the following, code: var t = htmlDoc.DocumentNode.SelectNodes("//table[@class='" + attr +…
-
-1
votes1
answer213
viewsPass values via Ajax to ASP.NET MVC Controller
I want to pass values via ajax of a text field on my screen for my action, I am doing as follows: $('#Regra').change(function () { if ($(this).val().trim != '') { var regra = $('#Regra').val(); var…
-
-1
votes2
answers330
viewsCiclo for javascript - unexpected result
I’m having problems solving this issue: Create a function called caloriasDeTrote(), which receives per parameter the number of turns represented by a numerical value and returns the amount of…
-
-1
votes1
answer159
viewsList part of a JSON file using C#
For reasons of errors with a Windows version I ended up not working with databases and started using files JSON. But I need to upload only part of the items (List) to one DataGridView according to…
-
-1
votes1
answer213
viewsC# Backgroundworker
Hello, I am with the following message, it is the first time q I am working with Backgroundworker and I run a long function inside the function (Dowork) of the Backgroundworker however it happens…
c#asked 4 years, 12 months ago Cristiano Rogoy 3 -
-1
votes1
answer266
viewsC# - Form track Panel size
Hi, I would like to know how I make the open form inside a Panel to follow the Panel if I resize the main form. Form2 frm = new Form2(); frm.TopLevel = false; frm.Size = panel1.Size;…
-
-1
votes1
answer315
viewsCannot implicitly convert void to string in abstract classes
My abstract class code has two errors: Cannot implicitly convert "void" to "string" (Line 5, 6, 11, 12, 17, 18, 23, 24) using static System.Console; public abstract class DevilHunter { public string…
-
-1
votes1
answer68
viewsSystem.Windows.Forms.HtmlDocument.Body.get returned null
I am creating HTML elements by C# using Webbrowser, I am not using the URL property, just using pure code. When I try to use this command: this.webBrowser1.DocumentText =…
-
-1
votes1
answer241
viewsHow to initialize BSO and PSO variables from the Spring environment?
I intend to initialize two context variables being ErpBS BSO and StdBSInterfPub PSO when I add an extension to Spring. Why? I would like to use these variables with static classes and/or with Forms…
-
-1
votes1
answer104
viewsHow to insert a Dictionary as an array in the Mongo using c#
I’m mounting a monitoring system, I have a process class that gets a string NomeDoProcesso, and a Dictionary<string,Float>Variavel, in which the user enters the variable name in a textBox, and…
-
-1
votes1
answer51
viewsVariable this.variable does not load the information for search, but for listing uploaded
The code is available at:Github I got the Main Class: static void Main(string[] args) { ControleClienteService controleCliente = new ControleClienteService(); controleCliente.CarregarCliente();…
-
-1
votes1
answer87
viewsCefsharp - Paste Clipboard text into input at onclick event
I have a input within a Iframe on a page .html in https with the event onclick calling a function: <input type="text" value="" id="TXT_PROTOCOLO" placeholder="Clique para colar o protocolo"…
-
-1
votes1
answer51
viewsAsp Net MVC Dropdownlist Mustache
in my application when the user clicks to include performing two queries and each returns (id and name), I set up a mustache template, and would like to load this data in two dropdownlist. the…
-
-1
votes1
answer168
viewsValidation with more Net Core MVC fields?
I need to validate on a form made in ASPNet Core MVC, but in this validation I need to use more than one field, example below: Models: public class Fornecedor { public virtual int ID { get; set; }…
-
-1
votes1
answer88
viewsFTP Request timeout with NET Provider only
I use FTP, to download files to my system, it is a very simple code, using FTP REQUEST, however I am facing problems with who uses the NET provider(and some others however the Net is more evident)…
-
-1
votes1
answer160
viewsBuild failed. - error creating migration
Good afternoon. I am starting a web project that is generating an error using the command: "dotnet Ef database drop" I used at the end of the -v command to generate a complete message. Error…
c# visual-studio-code entity-framework-core migrations dotnet-cliasked 4 years, 10 months ago Allan Alencar 1 -
-1
votes1
answer48
viewsHow to select from the end of a textbox
Good afternoon, you guys! My question is simple and a little silly, but it’s making me crack my head. My program has a textbox where a log is saved, at all times new data (characters) are added to…
-
-1
votes1
answer52
viewsError searching local database in Visual Studio 2019?
When trying to perform a query to a local database in Visual Studio, returns an exception. Code I am using in FORM1, LOGIN button. string sql = "(SELECT * FROM Login WHERE CNPJ…
c#asked 4 years, 10 months ago Thiago Santana 9