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
answer219
viewsOpen a minimized browser in Windows Forms
I am making an application in Windows Forms and I have the following problem, when the user click a button of form, it will have to maximize a web page that is minimized, ie bring the browser window…
-
-1
votes2
answers107
viewsNumericupdown lock down
How to block or control the "Down" state of the Numericupdown component of Windows Forms ? Ex: First time the user makes a "registration", he can Add or Remove the Quantity, in the second…
-
-1
votes1
answer327
views -
-1
votes1
answer154
viewsI can use two Insert into in the same command
i have the following line of code and wanted to know if it is possible to make two select within a single sql command cmd = new MySqlCommand("insert into FUNCIONARIO(`CPF_FUNCIONARIO`,…
-
-1
votes1
answer268
viewsSetting cursor at string position within textbox
I’m trying to make a mask for a textbox manually, and I’m trying to imitate the Windows calculator, where when the user writes 1000 the code automatically puts 1.000 and when I give one…
-
-1
votes1
answer551
viewsQuaternions in Unity3d
Well... I wish I knew more about Quaternions in Unity... I didn’t understand very well what they do... and why they use the Quaternions and not the Angles of Euler... I didn’t find good material…
-
-1
votes1
answer465
viewsGooglelocationservice problem getting latitude and longitude
Follows the code: Try 1:(It works) var address = "Osasco - SP, Brasil"; var locationService = new GoogleLocationService(); var point = locationService.GetLatLongFromAddress(address); Attempt 2:…
-
-1
votes1
answer516
viewsCS0029 error in Visual Studio
I’m trying to make a very simple calculator, just to understand how the program works, and I came across the following problem: If I put 5+5 in the calculator it gives me the value of 55 as a…
-
-1
votes1
answer1380
viewsError No service for type 'Microsoft.AspNetCore.Http.Ihttpcontextaccessor' has been Registered
To help those who are going through the same problem (ANSWER BELOW). Scenario: I am developing an ASP.NET CORE MVC application where I am working with Httpcontextaccessor and the error occurs below.…
-
-1
votes1
answer36
viewsInstance error
I’m getting the following error: Referência de objeto não definida para uma instância de um objeto. The line generating the error is as follows: var _TceView =…
-
-1
votes2
answers114
viewsUsing the Click event inside an IF
Hello, I wonder if it is possible to use a Click event inside an IF. I will try to explain my situation. At the moment I have this: foreach (Label lblCor in panel1.Controls) if (lblNum.Text ==…
c#asked 5 years, 9 months ago D. Rodrigues 79 -
-1
votes2
answers695
viewsCommand to perform the Down of a migration
With the command add-migration created a migration, so is created a class with two functions. protected override void Up(MigrationBuilder migrationBuilder){...} protected override void…
-
-1
votes1
answer143
viewsSpecify custom View paths in ASP NET Core 2.0 MVC 5?
I’m having a big problem specifying the path I want the controller to search for the view relating to it. I’m using more than one subfolder within an area: I want the controller to be able to…
-
-1
votes1
answer64
viewsLeftover space in Datagridview c#
I have a Datagridview that has as source a Datatable. But there was a gray border left below the last line. I’d like the space I put on the Datagrid form to be filled in completely. I tried some…
-
-1
votes1
answer57
viewsConvert XSD file to c# class in visual studio 2010
I would like to know how I generate a c# class based on an XSD in visual studio 2010?
-
-1
votes1
answer105
viewsList local windows groups with Forms c#
Good users! I’m trying to list all the local windows groups with Forms c#, but I was not successful. I want to list the groups and from there select and include in the user’s creation. thank you in…
-
-1
votes1
answer225
viewsGeneric interface
I’m creating a web service WCF which will expose methods to do CRUD operations in a database. And I’m having doubts on how to create the contract interface. The Service will enable CRUD in multiple…
c#asked 7 years, 9 months ago Matheus Saraiva 2,157 -
-1
votes2
answers148
viewsHow to create a "Line Counter" in a texbox
I wish I could count the lines Visual Code, Atom or any such publisher. Follow an example image Details: My project runs in c# form, one of the Forms would have a txtbox with the line counter. I’ll…
-
-1
votes2
answers166
viewsQuery return comparison with "N" status
I need help for comparison in "if" c# of a datatable database return. Below the code snippet: public class ArcerarDto { public DataTable SelectArcerarContract() { ArcerarDal arcerarObj = new…
-
-1
votes5
answers258
viewsHow to open more than one View in a controller?
I have a controller called Request: [HttpPost] public ActionResult Pedido() { return View(); } How to open more than one View in a Controller? By calling a Controller would like to open two views.…
-
-1
votes3
answers59
viewsConvert inside a lambda
I have a nullable int field and that within a lambda I need to popular a nonnullable property. If I do this: campo1 = Convert.ToInt32(campo2); I take this mistake: Notsupportedexception: LINQ to…
-
-1
votes1
answer38
viewsVisual Studio C++ Strings in Hexa
I am creating a program in Visual Studio C++ with UI to do RS-232 communication with some weather cameras, for that I have to send a String in Hexa. String is sent in this format: String^ a1 =…
-
-1
votes1
answer31
viewsNotifying the Browser via backend
So, I’m making a method that generates a pdf, but since the file is large, I thought to "warn" the browser when the file is finished. This can be done with Signalr? thank you guys! abs
-
-1
votes2
answers979
viewsConvert value to C#object
I am doing an integration where the system uses socket connection, I send and receive messages to reach an end, and the messages comes in this format: aplicacao="Teste" retorno="1" sequencial="191"…
-
-1
votes1
answer530
viewsYou must declare a body because it is not marked as Abstract, extern or partial
I’m new to programming and I’m trying to use the Class Sendkeys following this link, but when placing the: public static void Send(string keys); the compiler returns me the following error: *Error…
-
-1
votes1
answer347
viewsCompare string ignoring uppercase/lowercase letters C#
How to check if two strings are equal by ignoring upper and lower case letters?
c#asked 5 years, 7 months ago Artur Brasil 501 -
-1
votes1
answer96
viewsWhich component should I use?
I am creating a system, and there is one similar to mine, in the table of the image, I will create a list, where will have a check, a label, 2 textedit and an image to indicate q the check this…
-
-1
votes2
answers137
viewsHow to use Readkeey in C#
int loop = 0; while( loop >= 0 ) { int aa; int an; Console.WriteLine( " Qual o Ano Atual? : " ); aa = Convert.ToInt16( Console.ReadLine() ); Console.WriteLine( " Qual o Ano de Nascimento? : " );…
-
-1
votes2
answers147
viewsPass values to 99 fields in a loop
I would like to pass values to 99 fields in one loop; For example: for(int i=1; i<= 99 ; i++) { nomedocampo + "i" = "valorqualquer"; }
-
-1
votes1
answer328
viewsIf I declare a global variable for my page, is it accessible only in this session?
Hello, I have a question. If I declare global variables for page, they are unique to this session or they can be changed in other sessions? I had problems in other systems that I developed with the…
-
-1
votes2
answers73
viewsVariable is not receiving value - C#
Please, I need help, I have three whole variables, one of which receives the result of the division of the other two, but the recipient is not receiving the value, would anyone know why? The two…
-
-1
votes3
answers495
viewsJoin two projects into one
I have two projects in Visual Studio, Project 1 has some things that Project 2 doesn’t have, and Project 2 has some things that Project 1 doesn’t have. So I need to merge the two and turn it into…
-
-1
votes1
answer41
viewsHaving problems with C#Assembly. Does not accept NPOI Updated
I have a question. I am trying to update the NPOI of an application, but it bursts the following error: Failed to export report (description: Unable to load file or Assembly 'NPOI, Version=1.2.3.0,…
-
-1
votes1
answer33
viewsConvert a string to number
I am reading in an excel file, but the values of them are coming in this format. "-3,6379788070917E-12" Code for conversion from string to decimal. decimal.Parse(linha[5]); When I do the error…
-
-1
votes1
answer59
viewsWeb api c# - Get current path in controller
How do I get the current path of an endpoint in the controller?
-
-1
votes2
answers1046
viewsHow to Save Date, Time, Minute, and Second in C# WINFORMS and SQL SERVER?
I created a sales system, and I need you to record the date, time, minutes and seconds. The way I did, it only records the date, and the rest comes 00:00. Below is the code of what I did: //evento…
-
-1
votes1
answer39
viewsHow to share menu between ASP.net core applications
How to share menu between applications? We have several applications and all have the same menu, example: Home | Beneficiary | Accredited When new item appears we need to replicate in all…
-
-1
votes1
answer31
viewsC# Spire.Xls set list of workbooks
How can I create a list of workbooks Example of workbooks created to add the list: private static void Merge() { Workbook workbook = new Workbook(); workbook.LoadFromFile(@"merge1.xlsx"); Workbook…
-
-1
votes1
answer221
viewsParse de Json in C#
I’m trying to parse Json for a listbox and I’m not succeeding. This url is an example of what I’m trying to parse... and this is what I have: public void button1_Click(object sender, EventArgs e) {…
-
-1
votes1
answer77
viewsconvert nvarchar to bit C#
good night! its new in C language# would like to know how to convert nvarchar to bit System.Data.Sqlclient.Sqlexception: 'Failed to convert nvarchar value 'Punctual Payment' to bit data type.'…
-
-1
votes1
answer91
viewsC# press key multiple times
I’m using c# to navigate enttet buttons and textbox a page. For this I use the TAB key because the names of the page objects are dynamic, every time the site updates the id and class change. I’m…
-
-1
votes1
answer45
viewsC Sharp with linux
I have already installed my Tom on my linux I would like to know how to compile my code in C Sharp ?
-
-1
votes1
answer78
viewsHow to update a document line field in V9?
I was looking at examples of V10 codes and I found this, // Add new line to the invoice and set all the item related information. PriEngine.Engine.Vendas.Documentos.AdicionaLinha(invoice,…
c#asked 5 years, 4 months ago acamiloMoz 69 -
-1
votes1
answer76
viewsData structure in C# for neighbor-nearest?
Currently I’m putting all positions in an ordered vector. When I want the nearest neighbor, step through the whole vector. I want to know if there’s a structure in any namespace from C# to this.…
-
-1
votes1
answer251
viewsEnable Images in Datagridview
Good morning, you guys! I’m new here, sorry if I’m posting my question in the wrong place. More let’s go there. I have a form that has a Datagridview, where this grid has the fields that was made by…
c#asked 5 years, 3 months ago Jamisson Ramos 1 -
-1
votes1
answer66
viewsDispatchertimer C# error (Universal app win 10)
I am new to programming and I was able to make this code with help, only there is an error. follow picture. public sealed partial class MainPage : Page { private MySqlConnection _connection;…
-
-1
votes1
answer41
viewsTextbox in WPF datagrid
Good afternoon, as I add a Textbox as the image below. I’ve seen some C#/WPF software with Datagrid and filtering this way.…
-
-1
votes1
answer31
viewsMessage when net core exception occurs
I have 1 to 1 relationship between company and user but when the user has already registered 1 company and try to register another I want to show a message other than how can I do?…
-
-1
votes1
answer192
viewsPython Convert XLS (2003) to XLSX
Good Morning! Guys, I have a directory with several spreadsheets exported from my system in XLS format (Excel format 97 - 2003), I need to write a script to go through this directory and convert…
-
-1
votes1
answer92
viewsHow to make windows form take up all the space within the MDI application?
I am creating a registration and management system that works only with CRUD. The whole functional part of the system is working perfectly, but there’s something that’s been bothering me. I’m using…