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
votes3
answers106
viewsFilter per parameter or all
I make an appointment at the bank. I would like to filter the column ID_LEAD by the filter value "if there is" int?(filter.code) or filter all over the world. follows the example of how this in the…
-
1
votes1
answer613
viewsInvalid Resx File
I am starting, and while doing an example of a simple calculator when saving a jpeg file to put on the button, it got very large and when I went to resize the file and then add to the button…
-
1
votes3
answers2438
viewsDoubt in Calculation of %
Could anyone explain to me how to make the following formula? I have 3 values: Valor_Vendido, Valor_Minimo_A_Ser_Vendido and %_Atingida. Example: I sold 500 reais and the Valor_Minimo_A_Ser_Vendido…
-
1
votes0
answers136
viewsWindows Phone: Sale with credit card
I need to carry out the sale with credit card through my application. I would not like the customer to enter his data on the phone, the sale would be made in person. It does not serve the sale for a…
-
1
votes2
answers1756
viewsC# Challenge Variable value exchange
I recently made a very simple challenge : Swap the value of two variables without using a third variable. int a = 5; int b = 3; a += b; // a = 8 b = a - b; // b = 5; a -= b; // a = 3; It is simple…
-
1
votes1
answer374
viewsBrowse Sites By Clicking Previous and Next Buttons
I would like to have Webbrowser browse a list of sites by clicking the Previous and Next button to browse the sites.…
-
1
votes0
answers126
viewsProblem accessing a Resource through my C#class
The problem is in a project I’m doing added 2 resources Main.resx I want to get data inside this Resource this way: System.Resources.ResourceManager rm = new…
-
1
votes1
answer745
viewsWhy doesn’t Webbrowser show us reCaptchas?
I put to navigate normally on this site. However it not only deform the Textbox of the site, it still does not display the reCaptchas. The site of Scripterros. But other sites do, too, but it’s not…
-
1
votes0
answers164
viewsERR_CONNECTION_TIMED_OUT when Running Project by Visual Studio
I have this error while running my project. I have already searched for this error on other sites and found no answers. Unable to access this site localhost took a long time to respond. Search…
-
1
votes2
answers515
viewsAbout Date in Mysql
I’m doing a program for a college job, with a database connection. On a table, I have a column NASCIMENTO of the kind DATE. On the show I have a MaskedTextBox to enter the date of birth, but I put…
-
1
votes1
answer248
viewsProblem with Many Interface Automapper for Many C#
I have two classes with a relation of many to many, all the mapping is already ready, the insertion is working, but when I try to do the Automapper it enters an infinite loop. Workflow: public class…
-
1
votes2
answers411
viewsFluent API and Migration
I have the following scenario: public abstract class Pessoa { /* Propriedades do Pessoa*/ public Guid IdPessoa { get; set; } } public class Cliente : Pessoa { public Cliente() { IdPessoa =…
-
1
votes1
answer647
viewsRelative Path with virtual subdirectory
Good afternoon, I’ve been searching the internet for solutions to this my current problem with paths, but I can’t find. Imagine that I have the following links: www.site/Files/Uploads/image.png…
-
1
votes1
answer902
viewsSending email to Asp net - Gmail
Follow the email sending code, The error reported is in accessing with google SMTP. StringBuilder conteudo = new StringBuilder(); conteudo.Append("O Srº(ª) " + "<b>" + txtNome + "</b>" +…
-
1
votes1
answer121
viewsRepeated nodes xml c#
Hi, I needed some help. I have this code: XmlNodeList xnList = doc.GetElementsByTagName("Line"); foreach (XmlNode xn in xnList) { string salescode = xn["ProductCode"].InnerText; if (salescode ==…
-
1
votes1
answer42
viewsTwo databases communicate with the same template
I wanted to have a database for production and another for development separate the real data from the test environment data. The problem is I have no idea how to do that. I created a clone of my…
-
1
votes1
answer617
viewsView with 2 model inside a Viewmodel
Goal: Manipulate 2 model in the view using a Viewmodel. I made a Viewmodel to encapsulate the 2 models, but I can’t use one of them. Viewmodel: public class BoletoConfigViewModel { public Boleto…
-
1
votes2
answers212
viewsRead column values - C#
I need to read the values of a column called Code_article and place them, only when the column is still empty, I execute and immediately gives the error: The object reference was not defined as an…
-
1
votes0
answers199
viewsNpgsql - Entity Framework 6 Problem
I am finding problems to use Postgresql together with Entity Framework 6. When trying to fetch data from my repository I get the following message: The context cannot be used while the model is…
-
1
votes1
answer416
viewsConnection . dbml - Visual Studio 2017 ( C# + SQL Server 2016)
In Visual Studio 2012, there was an option to create the DB connection file at (Add > new Item ) and then choose the dbml extension file. Where is Visual Studio 2017? I remember it’s something…
-
1
votes1
answer202
viewsDelete listview item in Xamarin
How do I delete an item from my listview? I delete the item, but when I click on the next item the same item I deleted is selected. My code: adapter.Remove("LISTA 1"); adapter.Remove("LISTA 2");…
-
1
votes2
answers525
viewsPath null parameter
I’m trying to get into a controller, receive a parameter and print it in the View by a ViewData or ViewBag. My Controller: public ActionResult Index(string information) { ViewData["Bag"] =…
-
1
votes1
answer117
viewsDefine multiple styles for a Usercontrol via Staticresource’s in WPF
I’m starting to work with WPF because of its resemblance to HTML. I realized through my research that when I use an expression like this Style="{StaticResource MeuStyle}" looks a lot like a class…
-
1
votes1
answer360
viewsHow to do Reverse Engineering via Entityframework using a Firebird data source in Visualstudio 2015?
I have an already populated Firebird database and would like to use this same database for a Web project in visual studio 2015. I would like to use a library class and generate the model using EF…
-
1
votes2
answers230
viewsQuestion about how to position buttons
The images are only illustrative. What I need to do is this: There are several buttons with their respective names, can be so-called (clicked). I type the name of that button in the play fetch and…
-
1
votes1
answer143
viewsExecute mongoimport command via c#
I need to execute mongoimport command from mongoDB via code but not for sure: `pro.FileName = "cmd.exe"; //pro.UseShellExecute = false; pro.Arguments = @"/k cd C:\Program…
-
1
votes1
answer2403
viewsThread - How to use it without freezing screen?
I have a system that goes through some html elements, collecting some links. I would like to wait for a while, but whenever I use Thread.Sleep it freezes my program for the set time. I have used…
-
1
votes1
answer206
viewsJsonresult request with decimal type
Because when sending a request with a decimal type (3) the "Point" is deleted, see in the field INSS which is a decimal value, for example: I type 1,69 when making a bind in the template the stitch…
-
1
votes1
answer27
viewsC#(SPA) template does not run
I was auditioning with the Single Page Application, using the visual studio template. Well, I created the project and did nothing, nothing at all, I just created the project and I circled and…
-
1
votes0
answers501
viewsWebservice NF Paulistana does not return C#
Dear friends, good afternoon. I have some problems with the use of the webservice of the São Paulo tax bill, where I need to get the Received Tax Notes and bring me this information. I already…
-
1
votes0
answers35
viewsFill Dropdowlist with data from another screen
I have a time zone screen where I have the fields name of the time zone, utc and daylight time only, it works fine. only that I have to create another "time zone period" screen with three fields the…
-
1
votes2
answers658
viewsMapping Composite key nhibernate with Firebird bank
Guys I’m having difficulty in mapping composite primary key using nhibernate Fluent. I have the following class: public class NotaItem { public NotaItem(){} public virtual int Id { get; set; }…
-
1
votes1
answer378
viewsC# Help to Load External DLL PNG Sources
I created the Dll of Sources with IPNG magens in C# when I compile to read in PictureBox of Visual Studio I receive the news of NUll or of missing System.Resources.MissingManifestResourceException'…
c#asked 8 years, 8 months ago carlos coelho 128 -
1
votes2
answers86
viewsModel, relationship with Dataannotations
If I have an entity Customers public class Cliente { public int ClienteId { get; set; } public string Email { get; set; } public string Nome { get; set; } } If I create a Boleto entity public class…
-
1
votes2
answers442
viewsIs it possible to create mobile games with just c#?
Is it possible to create mobile apps as much as Android or IOS using only C# in the visual studio? the app in question is a game
-
1
votes0
answers281
viewsHTTP POST for Nota Fiscal
Dear friends, good afternoon. I need to send an XML via post to the webservice function of the São Paulo Fiscal Note. However, XML is correct, it only returns a message that is very generic, so it…
-
1
votes2
answers112
viewsSESSION: System confuses users who access it simultaneously
When 2 users access at the same time the system, somehow it confuses the users, not only the name, but their permissions as well... I am assigning the session after logging into Actionfilter public…
-
1
votes3
answers52
viewsI did a project using the VS2015 SPA template. I want to take the start login page
I made a project and when I rotate it is the login page that is the first to be shown. I would like to know how I make to leave the home page as main and not login. How I do this?
-
1
votes1
answer427
viewsList web file folder
I’m trying to list a folder of files, I’m not getting, the error says that the directoryinfo does not support URL. DirectoryInfo directoryinfo = new DirectoryInfo("http://127.0.0.1");…
-
1
votes1
answer2224
viewsQuery the database through a text box
Hello, right now I’m in a part of a project where I have to do a database search through a text box. For example, he searched for "José" and returned all the data contained in the database with the…
-
1
votes1
answer89
viewsLoss of Collection from a View Model to the Controller
I passed an object containing a collection with 2 objects of a controller to the view typed form. Now I would like the view pass this same object to another controller. The call URL passes the Model…
-
1
votes1
answer718
viewsHow to convert image size to A4 format with iTextSharp
Please, I am generating several images in a single PDF and it is running correctly. What I can’t do is leave the A4 size on the images because they’re too big, like 80% of the standard size. How can…
-
1
votes1
answer754
viewsAlgorithm of adjacent numbers with complexity O (N * log (N))
I made an algorithm that returns the minimum value between two distances in a given array. I wonder if there is still some way to improve the algorithm by looking at complexity O(N*log(N)). Below…
c#asked 8 years, 8 months ago Al Unser Albuquerque 965 -
1
votes0
answers152
viewsBlock viewing and editing of Crystal Reports' RPT file
I have an application in C# and created some reports that are in the application folder, the problem is that if someone copies the report files (.rpt) the same if you have Crystal Reports installed…
-
1
votes1
answer26
viewsReturn of Service
I am with the following problem, I make an ajax call to my service and it returns me a paged list everything ok.. And I have a button where I download to excel, only because it is a very heavy table…
-
1
votes1
answer51
viewsC# API - Update
I created an API using Entity Framework, the connection is ok, however, when I update the data in the database, qlqr one of the fields, Json in the API does not show the change. How to resolve this…
-
1
votes0
answers87
viewsSpecifications and Dapper
Hello, does anyone know any extension of dapper that makes it possible to use Specifications (Expression<Func<T, bool>>) in c#?
-
1
votes2
answers63
viewsHow do I get the usermanager property started in my Model
I wanted to form the field Name is automatically filled in by the username you are logged in to. How to include this property in mine Model? public class Condominio { public int CondominioId { get;…
-
1
votes2
answers266
viewsCreate tooltips using Attributes
I created a custom attribute called Tooltip. I would like to add tooltips to any property that has this attribute. Example: In my model I have the following property: [Required, ToolTip("Neste campo…
-
1
votes2
answers725
viewsLimit Editfor input in MVC
I have a character limiter for TEXT only. Now I need the characters to be limited in only 2 (I want to make the user type the state, for example: PR, SP, RJ...). How I do it?…