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
answer114
viewsOrganizing forms inheritance - C#
I’m doing a program for selling products and I have a design problem. The differential of this program is that it can take on two different faces: one for the sale of chocolates and the other for…
-
2
votes2
answers441
viewsSystem.Data.Sqlclient.Sqlexception: Conversion failed when Converting the varchar value to int
I’m getting this Exception in c# when I try to read SQL data. I’m wondering if this error is a problem with my SQL or C#. My SQL code that makes the conversion is this: `$ (SELECT ORDEM FROM TABELA…
-
2
votes1
answer740
viewsWelcome page in HTML
Good. Before developing a website in C# Asp.net I created a sketch on Wix. Only now I don’t know how to put the first page of this kind, that is, a small window (with the index behind it) before…
-
2
votes1
answer191
viewsAlternative C# Windows Service
Hello, I have some windows services written in C# (Framework 4.0) running on server here in the company, these services perform some monitoring to make information available for when the user logs…
-
2
votes1
answer230
viewsInaccessible logs error: Security
Good afternoon, I recently got the following error The source was not found, but some or all Event logs could not be searched. To create the source, you need permission to read all Event logs to…
-
2
votes0
answers897
viewsError 500 when consuming Webservice
The code is returning the following error message: An unhandled Exception of type 'System.Net.Webexception' occurred in System.dll Additional information: Remote server returned an error: (500)…
-
2
votes0
answers25
viewsDescription of the EF Core Field
Good Morning Assuming I have a 'Description' field in the database, as I do via Fluent API for in return come "Description" (so it can be written correctly on screen )
-
2
votes1
answer567
viewsSQL SERVER EXPRESS 2014 ERROR (Microsoft SQL Server, error 1225)
Good morning, all right guys? Following work with database, and we are having some problems with SQL SERVER 2014 x64, on Windows 10. I am doing the installation normally and changing the network…
-
2
votes1
answer80
viewsUse Separate Date Time
I have a Datahora field and wanted to use it separately, that is, a single field in the database called Datahora of the datetime type, and manipulate this field with two editorfor where I save the…
-
2
votes1
answer85
viewsRead from a pre line defined in txt
I am making a txt file to save some information of a root user (user,password,name,Cpf,email) in order, and I would like to know how to read only the line that I would like, Cpf or email or user.…
-
2
votes3
answers251
viewsHow to separate in pairs the digits of a variable in C#?
How I take a variable that has a value of 4 digits, divide these digits into pairs and save them into other variables? example: 3025 = 30 25
c#asked 6 years, 4 months ago Rafael Barros 31 -
2
votes1
answer35
viewsParameters in the URL using /
I need to have a URL in the following format: nomedosite.com/note/{anything} I need this URL to trigger the controller Note, with the action Index. How should I set my route? I tried to use this:…
-
2
votes1
answer2676
viewsWeb Service Tracking Couriers
I have often read the manual of use of the web mail tracking service and I couldn’t understand how I can access the user and password. I’ve been trying for days to understand and I can’t.…
-
2
votes0
answers65
viewsPut web application online (publish) done in visual studio?
I developed a website on Asp.net C# in the Visual Studio 2013 for a company. This company wants to replace its current website with the one I developed. This site is located on the server of a…
-
2
votes1
answer2005
viewsHow to create a mvc project in visual studio code
I’m starting to learn how to develop for web with c# in visual studio code. I am trying to create a web project, the problem is that the command I am using "dotnet new MVC -the Folder Name " already…
-
2
votes1
answer252
viewsClose form without destroying C# visual Studio
I am using a form in my application that needs to be loaded quickly, but when I close this form it always takes time to load, there is a way for me to close the form but it does not reload every…
-
2
votes1
answer902
viewsHow to use Event Eventargs
Maybe the question was too comprehensive, but I wanted to know how to use the EventArgs of certain components, such as EventArgs in the Button_Click. Explaining the doubt a little better, for…
-
2
votes1
answer614
viewsTransform Image into byte?
I need to capture an image of a printer in the /doc, write your bytes in a text file and save to another folder in the /doc. How can I do that?
c#asked 6 years, 3 months ago Vinicius Marson 63 -
2
votes1
answer61
viewsHow to disable Ctrl+V from the contextmenu?
In the textbox you can’t paste at all, the following code works right: private void Textbox_PreviewExecuted(object sender, ExecutedRoutedEventArgs e) { if (e.Command == ApplicationCommands.Paste) {…
-
2
votes1
answer69
viewsHow to split a Datetime-like column from an Entity Framework query?
I own a field of the kind DateTime? (void allowed) which is in the full date/hour formed (dd/MM/yyyy hh:mm:ss). I need to display the date and time in separate columns in a datagridview. I tried to…
-
2
votes1
answer111
viewsFilehelpers . NET CORE 2.0
I’m migrating an application to. NET CORE 2.0 and the application used the Filehelpers library, I entered the library’s github and found that it has not yet been migrated to . NET CORE ... I wonder…
-
2
votes0
answers450
viewsStandard for the use of logs
I have a project organized as follows: 1. Web (ASP.NET MVC) 2. Application 3. Domain 4. Infra.Data 5. Infra.Log (NLog) 6. Infra.IoC The project references are as follows: - Web --> Application -…
-
2
votes2
answers173
viewsHow to Consume Less Memory in C#Runtime?
What I’d like to know is what are the most efficient ways to consume less memory in Runtime. Use of variables "Static" ? Create object with instants or a static class? Use of the Dispose() to free…
-
2
votes3
answers682
viewsHow to mount a lambda expression and pass it by parameter to a Generic function?
I need to pass two parameters to a generic function that returns database data and select only a few specific columns to display in one DataGridView. public List<TEntity>…
-
2
votes2
answers1377
viewsHow, after a POST request, to receive JSON feedback on C#?
I need that after making a requisition POST http, I also receive the json return that is in the echo of php. This is the test code on php <?php if(isset($_POST['request'])) { echo $jsonret =…
-
2
votes1
answer508
viewsPass lambda statement by parameter - C# - Entity
I have a method in which I need to pass only one select per parameter: public List<TEntity> GetAll(Expression<Func<TEntity, TEntity>> Select) { var query =…
-
2
votes1
answer71
viewsthe local variable `Texture' cannot be declared in this Scope because it will Give a Different Mean to Texture
I’m new to c# script in unity3d I get an error in EditorFacebookMockDialog.cs: the local variable `Texture' cannot be declared in this Scope because it will Give a Different Mean to Texture how can…
-
2
votes3
answers5247
viewsSystem.Unauthorizedaccessexception in C#
Well, I’m trying to develop an automatic setup for a program I developed. First, it would create a folder in C:/Filename; then it would download a Github repository as .zip in this folder, then…
c#asked 7 years, 11 months ago Pedro Brito 65 -
2
votes1
answer101
viewsBuild error: Name 'x' does not exist in current context
I’m trying to do this exercise in C#, but every time I try to compile it points out the error: The name i does not exist in the current context Someone knows how to fix this? int N, a, b; N =…
c#asked 6 years, 3 months ago Adriano Sanches 23 -
2
votes1
answer432
viewsHow to return value to a Datetimepicker? C#
I’m wanting to return data from a DataGridView for a DataTimePicker so that I can change this data and save it again, but I’m having a hard time doing so because the DataTimePicker does not accept…
-
2
votes2
answers596
viewsColor RGB in Visual Studio 2017?
How do I get more colors for the bottom of my form? I have a color in RGB and do not know how to put it beyond the colors already offered in Visual Studio 2017. I have tried searching the internet…
-
2
votes1
answer127
viewsHow to pass a JSON Object to a method in the webservice?
I’m trying to pass a JSON Object to a method in my controller and I’m not getting it, the problem is that the email field always returns null. How to do this ? I’m trying like this. JSON Object…
-
2
votes1
answer194
viewsEntity Framework Code-First - Automaticmigrationsenabled
I am learning Code-Fist and I came across the following situation: I am using the AutomaticMigrationsEnabled = true for the database to be synchronized with the classes. But the changes I make in…
-
2
votes2
answers868
viewshow to work with Partialview
I have the People Register, and I have the Address Register, which are in two separate classes, because the goal is that the user can have 2 or more addresses, as the delivery, and the collection.…
-
2
votes2
answers535
viewsImport a list to another Form C#
I don’t know how to import a list to another form, if anyone can help me. The code of the first form is like this: Note that I want to Transport the ListaFornecedores to the Form FrmNovoProduto.…
-
2
votes0
answers241
viewsMVC Component for Google Maps
I’m currently using the component Googlemap control for Asp.Net MVC to render Googlemaps maps. I am using this component because I will have to trace the route of a vehicle coming from the database…
-
2
votes2
answers100
viewsSQL query for Linq mvc4 c#
I’m not very familiar with Linq and I’m having a hard time turning this SQL query into Linq, can someone help me. I do the join of 6 tables (it wasn’t me who made the database. I have to work with…
-
2
votes2
answers922
viewsRecover External IP without third party services
I have a WPF application. I need to know the external IP of the machine running this application. I found some tutorials that teach to do this through the method DownloadString() class WebClient…
-
2
votes2
answers885
viewsSend email via c#
Good afternoon, I’m needing to send email via c#, ai for testing, wanted to know what are outlook/Hotmail credentials to send emails
-
2
votes2
answers222
viewsHow to show the Getall data I performed in an HTML table? MVC C# HTML
I’m running a simple site in mvc, by the college. I have to perform a crud. I created a getall method that lists all existing clients in a list. How can I pass the same to the view? I tried the line…
-
2
votes1
answer608
viewsGet windows logged in user to automatically authenticate on a website published in IIS 7.5
I am creating a web application with ASP.NET MVC 5, where when a network user accesses the address of my application by the browser the systems already automatically pick up which user is trying to…
-
2
votes1
answer1117
viewsProjects with synchronous and asynchronous Apis
I am developing a small project and have, for now, two entities: Product and Customer Product API is asynchronous (with Task and async) and client API is synchronous. I would like to know if there…
-
2
votes2
answers2020
viewsSplit String with . Split - C#
Good morning, everyone, I am trying to pick up a specific part of a string in Visual Studio, in which case the string in question is a directory path: "C: Users User File-2018.txt" I would like to…
-
2
votes0
answers40
viewsDifference between String and String in C#
Following example: String teste = "teste"; string teste2 = "teste2"; What is the guideline for using each of the forms?
-
2
votes0
answers354
viewsFilter the datagridview (Row filter)
I have an SQL database with two tables. One of them stores measures created(table 1) and other actions of these measures(table 2). I have entered on form one datagridView with the data of table 1…
-
2
votes1
answer282
viewsCreating ASP.NET Core File Folder
Hello I am generating a file folder via code, but it n appears as if in fact it is inside the project/solution, like this: I would like to create (via code) the file folder so that it is actually…
-
2
votes0
answers184
viewsSearch Gridview Asp.net data
I have a GridView called grvListaFuncionario which is populated by data from my database. I am facing a problem when searching the data on it. private void Pesquisar() { DataTable table = new…
-
2
votes1
answer30
viewsHow to invert Control.Controlcollection’s list of controls?
I am inserting in a Panel several Labels, as I am inserting, the first Label becomes last in Panel. But I wanted to reverse this process. I wanted the first Label that was inserted to be in the…
-
2
votes0
answers44
viewsThe entire data inside the dropdown loads in the get request and not in the post
I made an Edit function that works with 3 different models, get loads the id data I selected, but at post time, the integers within the dropdowns comes with attribute 0. Follow my code for…
-
2
votes2
answers304
viewsHow to Manipulate Objects in a Thread?
I have the following code: MinhaClasse[] obj = new MinhaClasse[QtdUsuario]; Thread th; For(int i = 0; i < QtdUsuario; i++) { obj[i] = new MinhaClasse(); th = new Thread(new…