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
votes1
answer140
viewsHow to encrypt Stringconnection to a Mysql remote database in C#
I am developing an application that I intend to sell, and so I created a serial verification system, which checks if that activation code is already associated with the PC MAC. I do this by…
-
0
votes1
answer248
viewsBlock download in an audio streaming
I have a Web MVC application in which it resumes an audio stream according to the received parameters: public new ActionResult File(string q, string url) { try { var query = new GetFileQuery() { q =…
-
0
votes1
answer944
viewsError 174 - The event will only be accepted after the beginning date of the employer’s obligation to eSocial
I wonder if anyone else gets this error when you send the "S-1000" to the restricted production environment, and how you can fix it. I’m finalizing the structure but I can’t successfully send once.…
-
0
votes1
answer164
viewsError when deleting record with Entity Framework when mapping entity
When I try to delete a record from the Mapper (Model to Domain) have the following error as return from E.F: failed because Another Entity of the same type already has the same Primary key value.…
-
0
votes3
answers222
viewsDecimal problems in the SQL string
I have an error: every time the variable c.Value_do_title passes the SQL string, automatically the "." that separates the Decimal is converted to ",". As you can see in this image, the variable is…
-
0
votes0
answers84
viewsError inserting documents into Mongodb
I made these Inserts by the shell of the Mongo: db.Operators.insert([{ Name:'Paulo de Tarso', Version:1 }, { Name:'José de Arimatéia', Version:1 }, { Name:'Catarina Silva', Version:3 }]) This is my…
-
0
votes0
answers178
viewsFile without extension
I have an application that streams an audio file on a page, but when trying to download the file it comes without extension. Follow the code I use : public HttpResponseMessage Get(string filename) {…
-
0
votes1
answer94
viewsPass a property to a Label on Xamarin
I need to make the label of my code receive the value of a property. <Grid BackgroundColor="Black"> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition>…
-
0
votes1
answer262
viewsConsume via Jquery-Ajax, an API on localhost:28033, from a page on localhost:7545
I’m trying to do one thing, but it’s not working. I have two projects . Net Core 2.0 , an API, and an MVC. I want to run ajax calls from the MVC project, to API project controllers. I open two…
-
0
votes2
answers134
viewsError creating a Custom Exception
I’m trying to simulate a custom exception, but when compiling I get an error. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;…
c#asked 6 years, 4 months ago Danielle Arruda torres 1,191 -
0
votes2
answers38
viewsRender css when transforming view into string
I’m using the method: protected string RenderPartialViewToString(string viewName, object model) { if (string.IsNullOrEmpty(viewName)) viewName =…
-
0
votes1
answer56
viewsRun an XMLA query using C#Webapi
My C# Webapi looks like this. using Microsoft.AnalysisServices.AdomdClient; using System; using System.Data; using System.Web.Http; using System.Xml; namespace FastReport.WebApi.Controllers {…
-
0
votes1
answer69
viewsProblem with Razor
I have a problem I haven’t been able to identify what you’re causing. When trying to enter the Log View, an "Inter-Ternal Server Error" occurs and the message appears below. I am using ASP.NET Core…
-
0
votes0
answers67
viewsWHERE failure when associating a query column in a view
I am passing some parameters to a view where I need to receive the return of this query. When setting the filters in the Where of my query, the return of the query informs the following error:…
-
0
votes0
answers103
viewsMultithread system file writing in c#
I am developing a system in which I find myself in the following scenario: a program needs to create a file piece by piece. It receives bytes from a server and so the file is created, it should work…
-
0
votes1
answer80
viewsHiding menu option according to loan type
Good afternoon, I am developing a registration system with Angularjs and C#, when registering a new user there are two types of users to choose, administrator and librarian, being administrator type…
-
0
votes1
answer71
viewsJavascript problems in ASP.Net MVC applications - Minification failed
I just upgraded my system on the server, and so I went to do the first tests and this agreeing the following errors in my Javascript scripts /* Minification failed. Returning unminified contents.…
-
0
votes1
answer139
viewsSimultaneous insertion of items and sales with C#, Windows Forms and Postgresql
Hello, I am developing a sales screen in C# Windows Forms. I’m just at the beginning of the project, but I came across a situation where I’m not sure what to do. I am using a Postgresql database, I…
-
0
votes0
answers61
viewsTextbox.Focus() problem. Repeats SQL by focusing on the field
I have a function that records some information in a table when leaving a TextBox (Leave). But when leaving, the focus returns to the first TextBox. When this occurs it directs the focus as it…
-
0
votes2
answers154
viewsWhy . all in an empty list returns true?
I was having an error in a business rule, and when investigating, I arrived at the following code snippet, the intention of which is to verify that all the processes on a list are active: return…
-
0
votes2
answers186
viewstype’T' must be a Reference type in order to use it as Parameter 'Tentity' in the Generic type or method
When trying to make a query using Iqueryable, I get the following error: Error 3 The type’T' must be a Reference type in order to use it as Parameter 'Tentity' in the Generic type or method…
-
0
votes1
answer207
viewsWCF Bytaarray Return Method gives error
I was trying to use a par method to adevolver a bytearray using ERP but get an exception spent some time saying Object Variable or With Block Not Set, which may be ? PS. Yes I know that the engine…
-
0
votes2
answers274
viewsUndefined object reference for an instance of an Asp.net object
blz? Next, I have a problem with the exception "Object reference not defined for an instance of an object", I have already sought several solutions, however, none satisfies and/or corrects my…
-
0
votes1
answer126
viewsWhere with date and time - Entity Framework
I am making a select with Entity framework. where I need to use Where, with date and time, in the select of SQL SERVER, I would do so: select dbo.contas_receber.id,…
-
0
votes0
answers62
viewsSelect with Entity does not work
I have this method that makes me a select but it does not return me anything. [WebMethod] [ScriptMethod(UseHttpGet = true)] public JsonResult GetContratos() { List<object> resultado = new…
-
0
votes0
answers150
viewsConvert API Json PHP to C#
Hello, I’m having trouble converting a PHP API to be used in C#, I can connect to the API but I can’t send data, someone could help me? Follows API in PHP: $process = curl_init("URL API");…
-
0
votes0
answers40
viewsRestart the while loop method
I have a script to generate a certain amount of random Cpfs in a text file. When executing the method that generates the random CPF within the while, the method is executed only once and always…
-
0
votes1
answer130
viewsShow xml nfe tag value in datagridview columns
I have a little problem because I am reading the tags of an xml of Nfe, but I am not able to show in the columns of datagridview, my code is reading the correct tags, but do not notice anything in…
c#asked 6 years, 4 months ago Junior Guerreiro 617 -
0
votes0
answers436
viewsNhibernate error: No persister for
I would like some help regarding the error presented when I try to record records with Nhibernate by XML mapping. The project has separate layers. In the domain project, is my entity: namespace…
-
0
votes0
answers85
viewsDeserialize an XML and display your data in an input
I need to create an upload button that by reading the xml of my invoice can display the key of the Nfe that is inside the tag , inside an input. I have used several methods and is not drying out.…
-
0
votes1
answer52
viewsC# MVC project launching Exception System.Invalidcastexecption
Dear colleagues, I am trying to learn how to develop an MVC project. But I am having some difficulties. When running the program, it runs normally, but when I want to record a product input note…
-
0
votes0
answers493
viewsMicroservices architecture authentication with C#
How to make a user authentication using the default API Gateway? I’ve read several articles but can’t find an example of code using Web API 2 and those I’ve seen using the Asp net core only makes…
-
0
votes1
answer339
viewsSqlite, check the exact difference between a date, time and minutes of the current date
I need to do a check between two dates, I need to check if the date, time and minutes of a field is greater than or equal to the current date, time and minutes, I am using the sqlite. SELECT * FROM…
-
0
votes1
answer154
viewsProblem Reading Text File with Streamreader
I have an application that has a form that when loaded performs the reading of a text file, from the first line to the last, with StreamReader. The problem is I can’t read this same file twice in a…
c#asked 6 years, 4 months ago Gilberto V. Gonçalves 43 -
0
votes1
answer29
viewsImporting an XML and using columns to calculate
I need a help, I’m importing xml from Nfe, and I’m using the QTDA field to do a calculation, only the quantity field in xml is composed this way, 360.0000 and when I import that field is 3600000…
c#asked 6 years, 4 months ago Junior Guerreiro 617 -
0
votes1
answer47
viewsHow to merge sublists from a class and return the result using Linq and C#
Hello, I am working with c# and I have the following situation: I have 2 classes in the system, Order and ProductSold; Order contains as property a List<ProductSold>; In certain Viewmodel, I…
-
0
votes1
answer31
viewsConverting Jobject with dynamic objects
I have been having this problem for some time, I need to take the values of the given object and add it in a list but I can’t find a way to map them because they are coming dynamically Array…
-
0
votes2
answers1149
viewsBhaskara formula in C# with VS 2017
Speak People! I’m using Visual Studio to learn C# , I created a button that when clicked should show the result of a Bhaskara formula. But everything that appears on the screen when testing boils…
-
0
votes1
answer64
viewsHow to show the Controller output in View c#
I would like how I can show my result that is in the controller method in the View. EX: Controller: public class SMSTarifado { public int QtdTarifados { get; set; } public int QtdEnviados { get;…
-
0
votes1
answer54
viewsImport xml data field
I’m making an import of tags from xml to fields of textbox in Windows Form, only that I am not able to import the data fields in the correct format, to a masktextbox in date format.How do I proceed…
c#asked 6 years, 4 months ago Junior Guerreiro 617 -
0
votes1
answer310
viewsUsing Itaucripto_.dll within web service (without registering on the server)
I tried to put the COM DLL in the webservice project (using the code below to include it): <Project ...> <ItemGroup> <COMFileReference Include="itaucripto_.dll">…
-
0
votes1
answer1167
viewsUnable to load type'<Projectname>. Mvcapplication 'when duplicating project
I duplicated my project in Visual Studio as follows: 1° I entered the filesystem and gave CTRL C + V in the briefcase SiteTeste which is the project folder. 2° I renamed the folder to Siteteste2 and…
-
0
votes0
answers42
viewsHow to verify that the user has completed the video on Admob for Unity?
Code: using UnityEngine; using System.Collections; using System.Collections.Generic; using GoogleMobileAds.Api; using UnityEngine.UI; public class AdmobScript : MonoBehaviour { int CoinOld; public…
-
0
votes0
answers100
viewsPerforming Sharepoint Search by Asp.net Form
Good guys, I’m using Sharepoint as a file database, but I’m having trouble searching a document in the folders. I’m using the . NET CSOM. protected void Pesquisar_Click(object sender, EventArgs e) {…
-
0
votes1
answer405
viewsHow to run and capture a command line output in C#
Guys, here’s the deal. I have an app that works on a command line. This application takes parameters per command line, e.g.: program.exe [parameters] I want to make an interface where I run this…
-
0
votes0
answers79
viewsHow to rotate an element in C#
I’m creating software that runs the video at a 90º angle. I’m using axWindowsMediaPlayer (plugin provided by winform). using System; using System.Collections.Generic; using System.ComponentModel;…
-
0
votes0
answers1059
viewsError 1053 service did not respond to start or control request in a timely manner
Hello! I did a windows sending and mailing service, but am getting error 1053 while trying to start it. I looked at several articles and forums and could not solve the problem. Could anyone explain…
-
0
votes1
answer252
viewsMap class to XML deserialization for C#
I need to map this XML to a C# class to deserialize via Restsharp Deserialization: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <rsp stat="ok"> <items total="1232177"…
-
0
votes0
answers51
viewsHow to compare arrays and datagridview through loops?
Good afternoon, everyone I have 7 text boxes that I made this way long[] Jornada; Jornada = new long[7]; Jornada[0] = TimeSpan.Parse(textboxjornadaseg.Text.ToString()).Ticks; Jornada[1]=…
-
0
votes0
answers41
viewsASP.NET Core - Search by daughter entities
I need to implement an API that receives parameters for daughter entities Example: api/Orders/5/Products or api/Orders/5/Products/10. I need to pick up only the products of order number 5 or still,…