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
votes2
answers608
viewsSelect columns dynamically with Linq
I have an action in an API that should return a model, but the fields that should be returned are informed in the request. I can do a query with the System.Linq.Dynamic.Core package, but the…
-
0
votes0
answers468
viewsError "Object reference not defined for an object instance."
I am developing a Windows service that installs normal, but every time the start, it accuses the following error: Pcservice Error on: 15/12/2016 10:53:13 Undefined object reference for an object…
c#asked 7 years, 11 months ago Fabio Torres 26 -
0
votes1
answer100
viewsComparison of database dates with system date
Hello! I need to compare the month of registration of information present in a database table with the current month provided by the system. In the database I register in a column the number for the…
-
0
votes2
answers100
viewsRazor language regionality
I’m having a problem with Razor (using MVC 2.1 .Net Core) when generating the screen, as follows code below, this appearing the correct date in my Local development environment, but after Publish…
-
0
votes1
answer29
viewsParallel execution
I have a process running in my application for control. This process runs within a timer. private void timer1_Tick(object sender, EventArgs e) { // bloco de instruções 1 // bloco de instruções 2 }…
-
0
votes1
answer133
viewsVertically center a label on Stackpanel
I’m trying to center vertically on one label within a StackPanel. I’ve already defined the attribute VerticalAlignment="Center" but I didn’t notice any difference in vertical positioning, as can be…
-
0
votes0
answers214
viewsUpload Image and save to Asp.net server
Friends could help me create a function to record the path + image name in the database, and save the image on my server ? I’m using the field model.PhotoName which is a string to store the path,…
-
0
votes1
answer963
viewsChange Title to display tooltip
I’m validating the email using tooltip to display the message. If at first the guy puts registered email the search is made and displayed the message that the "Registered Email", if he changes the…
-
0
votes1
answer76
viewsParser error in my application
Good evening guys, I’m trying to run my application but this Parser Error appears. I’ve already entered the webforms of Vendor to see if I find any error in the code but nothing, compile the project…
-
0
votes0
answers1658
viewsUnable to load file or Assembly 'System.Web.Mvc, Version=5.2.4.0, Culture=neutral
I’m trying to create this project https://msdn.microsoft.com/pt-br/library/dn539646.aspx but after opening the project for the first time and compiling, error occurs: Unable to load file or Assembly…
-
0
votes0
answers194
viewsAccent problem when doing mysql Dump in C# (latin1 and utf8)
I made a program in c# that dump in mysql, it is very cool, it selects the bank and does the dump alone,making a sql file on my computer, and I just need to climb the bank later to where I wish.…
-
0
votes1
answer313
viewsDataannotation validation displaying message in English
Good afternoon, In my system I made the validations with date Annotations, locally the messages are displayed in Portuguese, when I publish the text message on the host server is displayed in…
c#asked 6 years, 1 month ago Stand Alone 350 -
0
votes0
answers345
viewsDigital certified in ASP.NET Core 2.0
I have a project in ASP.NET Core 2.0 where I am generating PDF contracts, however, I need to sign them with the company’s A1 digital certificate, only this part is missing to finish the project.…
-
0
votes1
answer1266
viewsException without treatment: System.Stackoverflowexception
My project Winforms C# has a routine that returns approximately 6000 items. Every time the routine is shown in Connection.Open() of DataSet to StackOverflowException. I’ve never seen this mistake.…
-
0
votes1
answer89
viewsSpace identification in TXT Asp.net file
good evening, I am not able to display line break coming from my TXT file, I have a TXT file with 5 sentences, but when I put to display the default page by a literal loads the txt file but the…
-
0
votes1
answer861
viewsAlternatives for PHP
And I really like C# so I took a look at ASP, but I didn’t like it much. I’ve handled Nodejs and I like it a lot. I wanted a language like PHP, where you can put the code inside the HTML and…
-
0
votes1
answer43
views -
0
votes1
answer164
viewsWhy is there so much talk about security in targeted programming?
I program in C and now I decided to explore the world of POO through the C#language. I see that many people talk about security and this is precisely my doubt, when programming I see that the…
-
0
votes1
answer931
viewsSession configured on Web.Config and IIS Session State is expiring ahead of time
Setting: I store the Session of the user to keep it logged in to the system, but something is happening that in 10 minutes it is undone because the Session expired. But so much in the Web.Config how…
-
0
votes1
answer31
viewsLazy Load only loads data when Solution remains
Guys, I have the following problem: When I make the Entity Framework add a data in the database, it does, but does not return the attributes of the loaded Class type. In order for them to load…
c#asked 6 years, 1 month ago Carlos A. S. Moretti 50 -
0
votes1
answer142
viewsHow to set the Index of a List to start at 1 instead of 0 when populated
Whenever I populate a list in C#, as in the example below, as I add items, they are arranged starting at position 0 in index. If I add 5 items to my list, I will have the positions 0, 1, 2, 3 and 4.…
-
0
votes0
answers43
viewsSystem.Runtime.Serialization on UWP 10
I’m making an exception in a UWP, however, it seems that apps UWP do not have the same resources for serialization as classic applications. The code below does not work for UWP. using System; using…
-
0
votes0
answers78
viewsHow to make a space split?
I have this text: "resultados 2018 295 1 br" How do I separate by space and put in strings? example: string ano = argumento[0]; // iria ser 2018 string ano = argumento[1]; // iria ser 295 string ano…
-
0
votes1
answer33
viewsKeywords As and Is in C#
Well... I was a little confused about the keywords As and Is in C#... I didn’t understand the difference between them nor what they are for... I believe that it is not so difficult to find a…
-
0
votes2
answers139
viewsIs it possible to rewrite any code that uses pointers (C#) without using pointers in Node.js?
It is possible to rewrite any code in C/C# that uses pointers in a way that does the same thing without using them? My fear is more complex codes. The simple ones I believe are not difficult to…
-
0
votes1
answer60
viewsDate value from Jsonresult function 18/11/2018 00:00:00 javascript gets "/Date(1542506400000)/"
I’m having trouble receiving a function JsonResult that returns me a certain date and this date I am unable to pass to the Date field of my screen for reasons of coming a value other than field…
-
0
votes2
answers1171
viewsDLL import in C#
I joined a recent project that uses a Nearby printer to print tax coupons. The last one who worked on the project used a DLL (if I’m not mistaken in C++) that managed the printer. In the project,…
-
0
votes1
answer162
viewsDrag and drop Unity
I’m trying to develop a simple Android game in Unity, with drag and drop function. I used the following method to catch the object: public void drag(){ transform.position = Input.mousePosition; }…
-
0
votes2
answers113
viewsDoubt integration test
I think it’s a somewhat conceptual question about the subject, but come on: I have an example method that validates a user checking if it exists in the database, thus: public bool…
-
0
votes1
answer500
viewsCreate a Score string . txt without overwriting the file
The command written below does not create the score text. txt in the directory of the folder where the game is installed I also needed that the code below not overwrite the file but add the score…
c#asked 6 years ago Malyster Snur 7 -
0
votes1
answer44
viewsHow to make second select in "Read"?
Here is the code: public FileContentResult Foto() { byte[] byte_image = null; string query = "SELECT * FROM Tabela WHERE Coluna = @Parameter"; using (var connection = new…
c#asked 7 years, 11 months ago Matheus Miranda 5,375 -
0
votes1
answer331
viewsWPF Checkbox Combobox direct click on button after selection
I have some comboxboxes I fill with checkboxes. After selecting the items click on search, but the first click is used to compress the combo and then click again to trigger the button. Is there any…
-
0
votes1
answer45
viewsDoubt when searching for items with Entity
Guys, I have to pick up all the sales items concretized. Every item is recorded with a CART in a sale, in the sales table I have the CART. How do I get all these items? I made this code: public…
-
0
votes0
answers37
viewsHow can I convert values. Row to string and insert into a combobox? C#
I have the following code: for(int i = 1; i<dataTable.Rows.Count; i++) {comboBox.Items.Add( dataTable.Rows[i].ToString());} When I run the application, in combobox just appears to me…
c#asked 6 years ago Rafael Anunciada 21 -
0
votes1
answer50
viewsHow to Make a Help Balloon in WPF?
I am developing a WPF application, and in it, I need each Label to have an Informative Balloon, as example, Name* (full name); Could anyone help me? I would like to do in pure WPF, but if not, there…
-
0
votes1
answer104
viewsDoes`Webbrowser` use any native windows browsers as a base?
I see you can use one WebBrowser in the C# Form but I was wondering if he’s like a iFrame that uses the browser itself to create this navigation window. My question is whether he uses the Edge or…
-
0
votes2
answers276
viewsAccepting null fields from a Texbox
When I click on "Save", the program does a check of Texbox with a deal that I did not let pass repeated numbers, the problem is that it error if any Textbox is blank. Below is the Code I made saving…
-
0
votes0
answers38
views.NET Standard 1.2 - Fileversioninfo does not exist
Follows code: public static string GetVersion() { return FileVersionInfo .GetVersionInfo(Assembly.GetExecutingAssembly().Location) .ProductVersion; } I get error: CS0103 The name "Fileversioninfo"…
-
0
votes1
answer1894
viewsError: The request Entity’s media type 'Multipart/form-data' is not supported for this Resource
I’m trying to make a POST in a Webapi that is returning me the following error: The request Entity’s media type 'Multipart/form-data' is not supported for this Resource. Exceptionmessage: No…
-
0
votes1
answer1334
viewsHow to recover last record inserted in Firebird database?
My Sale table has a Code field with auto-increment and need to recover this code to insert in an associative table. string sql = $"INSERT INTO…
-
0
votes1
answer1634
viewsOverwrite Bootstrap classes with CSS file
I’m having a hard time overwriting some Bootstrap classes using a CSS file I created. I am using the Bundle to make these changes: public static void RegisterBundles(BundleCollection bundles, bool…
-
0
votes1
answer648
viewsEFD-Reinf - Invalid batch version. Version 1.04.00 must be used
I am generating the R-1000 record for shipping test in the EFD-Reinf restricted production environment, and I already got help here at Sopt same: How to consume EFD-Reinf Webservice in C#? (Sending…
-
0
votes1
answer417
viewsError When Updating Database with Entity Framework Core Code First
I have my Domain created with N objects and these objects are converted into table in the database, in Entity Framemework Core with Code First. If I create the database with the tables it creates…
-
0
votes0
answers51
viewsProblems using the Googlemaps.Locationservices API on ASPNET MVC
I’m working on a development that plots multiple longitude and latitude locations coming from the SQL SERVER database that load onto a map after typing some search data. Below is the screen with the…
-
0
votes1
answer88
viewsPass sequence of steps (methods) to window (wpf)
Greetings...I currently have a screen similar to the one presented below: This screen uses Backgroundworker to perform a sequence of steps and inform the user through the messages in the textblock a…
-
0
votes1
answer200
viewsCopy specific XML file TAG and merge with another XML file
Situation: - I need a single XML file that contains the data of all other existing and upcoming files. But I can’t just join one file with the other and I just need a specific tag. Is there any way…
-
0
votes1
answer2214
viewsHow to add values within an array?
I have an integer value and need to transform it into an array to sum each of the elements individually. I did it as follows (example): int n = 1230; string sn = Convert.ToString(n); //converte em…
-
0
votes1
answer70
viewsHow to run a method on startup of ALL Controllers?
I have a static class that carries language in relation to cookie stored or the URL. Throughout controller I have to insert once the following method: protected override void…
-
0
votes3
answers82
viewsError while traversing vector
The user pastes the values that will be saved within the array and then displays these values. However, the following error is occurring: An unhandled Exception of type…
-
0
votes2
answers71
viewsController code is executed but nothing happens
After much research without results I come here to ask you. The project is in MVC 5 using C#. This is the code that calls a MVC controller $('#btnPesquisa').click(function () { var textAPesquisar =…