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
votes2
answers653
viewsManipulating event button in various formats
Good guys, I’m trying to make a manipulation at the event button, in several forms different, I’m using C# WindowsFormAplication. Well, I will try to say my logic here (I hope you understand). I…
c#asked 9 years, 2 months ago Diego Angelo 35 -
2
votes0
answers42
viewsUpload App to Windows Store
I have a aplicativo universal raised in the visual studio 2015 updated. By uploading the application and displaying the following message : Error : "The declared package dependency does not exist.…
-
2
votes2
answers9037
viewsCPF mask in the textbox?
I’m using the following code: string numero = ""; private void MaskeditCPF(TextBox txt, KeyEventArgs e) { //Verifica de a tecla digitada foi algo diferente de números ou BackSpace if (e.Key !=…
-
2
votes2
answers181
viewsvisual studio sql error
Good people, I’m new in c# and then I’m seeing some tutorials connecting to the database only that this error appears to me: The code I made is all still based on a basic tutorial and I leave it…
-
2
votes2
answers853
viewsDynamic Report c#
I am preparing a report with the following structure: Well so far everything is set right, I’m using C# Windows Form, using the Reportviewer component to do the report, but when it comes to getting…
-
2
votes2
answers161
viewsC++ program communication with a C#
Good people, I’m going through a little problem, I have an application in c++ and I have to make the output of it read by a program made in C#. would you like to know if there is any way to do that?…
-
2
votes2
answers2275
viewsCircular reference between two projects
I’m working with two projects in one Solution. To use a form of Projectoa in the Projectob I made reference to the Projectoa in the Projectob, from this I have access to the Projectoa. But what if I…
-
2
votes2
answers5403
viewsCut the last character of a string C#
I’m creating an export from SQL for the TXT. With this I add the ";" tab after building each column. But at the end of the last column you are adding ";" as well. How do I get this ";" from the end…
-
2
votes1
answer2559
viewsRead HTML file
In my project I need to read an HTML file that in source code has a structure of an xml. I need to read this HTML file, get the value of xml tags that have there do a whole process to save this data…
-
2
votes0
answers361
viewsDoubt about using Identity in layers
I created an Aspnet MVC project with Identity to understand how the Identity part works. I made changes to the code, including roles and Claims. I switched this project to a company project, but the…
-
2
votes1
answer209
viewsAdding selected columns together
I have the following scenario: A table created in the Razor with several columns, where each row has a checkbox in place different from each other, and would like to do the checkbox sum clicked by…
-
2
votes1
answer84
viewsGenerate Property Internal set
Because from the version of Visual Studio 2015 every time I have an attribute generated in a class the same is generated with the set internal? In previous versions VS generated as public.…
-
2
votes1
answer125
viewsHow to make application lock/unlock on Windows startup?
I want to make an app that will have an option to call the Regedit (Windows Registry) and the user will be able to choose whether to lock or unlock so that the application is booted with Windows.…
-
2
votes1
answer758
viewsWrite to a label when it loads with the form
Well, I have a program that needs me to write using Abels, however these only work, and actually write when they are clicked, I would like someone to explain to me how I should proceed to be able to…
-
2
votes0
answers513
viewsSend a list to a web api using $http.put from Angularjs
I’m having trouble sending a list using the $http.put method from Angularjs, I can send an object normally, plus a list is not following, someone has some example code so that I can take this doubt…
-
2
votes1
answer177
viewsAutomatic email sending from a website
I have a hosting and my site is already in the air, I wonder if it is possible to schedule the automatic sending of email at a certain time, through the site. I’m programming in aspx
-
2
votes2
answers2201
viewsPerson registration using multiple viewModels and only one controller
I want to register a person, which I have divided into three entities: Person, Contact and Address. And I want it to be just a registration form. My create action in the person controller looks like…
-
2
votes3
answers1130
viewsWebbrowser - Click on elements of a website
Hello, everybody! Here’s the thing, I need to make my program click on an element. Here’s a photo to make it easier to understand: http://i.imgur.com/Uitnkvt.png I’ve tried a lot of things, but…
-
2
votes2
answers2051
viewsMerge two distinct lists using LINQ
I have two classes, Cliente and Endereco, where the client has 1 or more addresses, so it is a list of objects: class Cliente { public string Nome { get; set; } public string Cpf { get; set; }…
-
2
votes1
answer375
viewsUsercontrol x Form - Cancel screen event after UC validation
I have a Usercontrol, which does a validation in the Validated event, and on the screen, I have the Confirm button. When I use the ALT+C shortcut, to run the button event, it will run the Validated…
-
2
votes2
answers232
viewsC# error when trying to add an inherited component in Toolbox
I am trying to create a component that inherits from a Combox. I created the component by following the steps below, the project is available at:…
-
2
votes1
answer159
viewsWrong string to double conversion
I have in my app.config the following code: <add key="FolhaA4" value="0.168056514197457, 6.36413684210526"/> And here the method to get these key values: private double[]…
-
2
votes1
answer114
viewsNumbers and Percentage in string C# MVC
My string is not coming with strange characters, it is coming with numbers and percentage. Example: "[email protected]" stays "teste%40test.com" or "fictício" stays "fict%C3%ADcio"…
-
2
votes1
answer704
viewsHow to know the dimensions of an image that is in array of bytes or Base64?
I have the following code: var binario = _documentoWord.Content.EnhMetaFileBits; string img64Bytes = ""; var base64 = Convert.ToBase64String(binario, 0, binario.Length); byte[] imageBytesBase64 =…
-
2
votes2
answers180
viewsField sorting of Join with Line in Mysql (C#, MVC)
I have the following query: query = from p in db.pessoa join f in db.pessoa_origem on p.Pessoa_Origem_Id equals f.Id join s in db.pessoa_status on p.Pessoa_Status_Id equals s.Id join c in db.contato…
-
2
votes1
answer781
viewsDoubt when declaring Enum with string
numDeclarate an Enum type string, like this: public enum SEXO { M = "Masculino", F = "Feminino" } As I do to have an Enum similar to the one above. That way give error: Cannot implicitly Convert…
-
2
votes1
answer187
viewsProblem accessing List from a query
I’m starting today with Entity-Framework but I came across a problem that I believe is simple, but I couldn’t find the answer anywhere, perhaps because I’m not sure what to look for. The code is as…
-
2
votes1
answer552
viewsHow to accept 0 and negative values in decimal attribute using Dataannotations?
I have a class with values decimal which may receive a value of -10.00 to 10.00 (including 0), in Sql Server the equivalent value is a Numeric(5,2). The problem is that by creating my class…
-
2
votes1
answer226
viewsAccess to location in windows 10 (universal app)
I was trying to convert an old project of mine made for Windows phone 8.1 to a universal application for Windows 10, when I came across this error below. The question is, how do I fix it? , how do I…
-
2
votes1
answer230
viewsC# - Error after changing from 32 to 64bit
My project was compiling normal, but when I changed from 32 to 64 a lot of errors appeared. I ignore and continue several components disappear. I am new in C#. has how I restore the project to a…
c#asked 8 years, 4 months ago pleonardomv 31 -
2
votes1
answer197
viewsJavascript and Activex permissions on IIS
Hello, an Asp.Net MVC application uses Scripting.Filesystemobject to create text files. On the development machine works normally, this application was published on an IIS server and also worked…
-
2
votes1
answer807
viewsCustom Installation Path via SETUP
When I publish the windows form application, it already generates the Setup by the visual Studio 2010 which when running, installs in "program files" in windows 7 the Installation. I would like to…
-
2
votes3
answers329
viewsPass Controls to a function
I have an interface in Visual C#. In this interface I have a Class called T50 that contains all the variables I need. I have already implemented a button that saves the object created by the T50…
-
2
votes1
answer651
viewsChild actions are not allowed to perform redirect actions. MVC 5
On my homepage, there’s a shortcut button that opens a modal, and inside that modal is a partialView which points to a action within another controller. Until then quiet. <div class="modal fade"…
-
2
votes1
answer58
viewsError logging data in Viewmodel
Have that question where I did according to the answers, my logic... Only now, when registering the data, an error was generated. This error refers to a view property that cannot be null, which is…
-
2
votes0
answers54
viewsError creating a method in a legacy WFA application and polymorphism
I created a WFA project that will serve as a basis for the others, follows the description: I created a Formbase that has public control variables, such as operator name, date and time of access to…
-
2
votes2
answers4495
viewsHow to disable a button and to activate it, click on another button?
I created a calculator using Windows Forms, it ran perfectly, however when clicking the operation button before the number button (to insert a value in the display) an error happens that closes my…
-
2
votes1
answer153
viewsAdd selected lines from Gridcontrol to Observablecollection
I am trying to add my grid items to my Observablecollection but I am unsuccessful. I have a column that has the Checkbox that I put through the property ShowCheckBoxSelectorColumn. I have the…
-
2
votes1
answer95
viewsPublish of WPF applications
I made a Publish of a WPF application with the CD-ROM option. Well, I noticed that it creates some folders, an Autorun.inf, a setup.exe and a Nome_Programa.Application. I was doing some tests,…
-
2
votes1
answer634
viewsConditional formatting on a gridView
I have a gridView where it’s loaded, from my SQLServer, all bank information. My question is this. can change the color of the source when a date is less than the date of the system (for example,…
-
2
votes1
answer957
viewsForm using Begincollectionitem gets null viewModel in foreach
I want to make a form where I can register several addresses and phones to a single person, and I want to be able to do this when I’m registering the person. Based on the answers to my other…
-
2
votes1
answer977
viewsError writing file stream
The flow was not writable You receive this exception when trying to change a file that is on Resource. Follows the code: var assembly = Assembly.GetExecutingAssembly(); Stream str =…
-
2
votes1
answer366
viewsHttpcontext receive parameter from jQuery
I’m having a hard time getting a parameter from a registration form to an . ashx. This is a simple form that will receive registration data and upload a resume. The upload script I downloaded from…
-
2
votes2
answers197
viewsASP.NET Web Forms and Ajaxcontroltoolkit
When adding a ajax:ModalPopupExtender on my page I’m having the following error <%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"…
-
2
votes1
answer247
viewsProblems passing a list of objects to another list
I need to pass, a list of objects from one table, to another list of objects from another table, I’ve been able to find the information, but I can’t save them. Ex: I have a table of people, in case…
-
2
votes1
answer182
viewsMicrosoft SQL Server for Mysql
I need some help. I downloaded a project in c# stock control, but the database is by Microsoft SQL Server, and would like to use Mysql for connection and data logging. Follow example of connection…
-
2
votes1
answer460
viewsError connecting remote database
Good evening, I’m having trouble with the following context: MySql Using the line of code below I tried to connect to a remote mysql server to try to access some tables and comes the following…
-
2
votes1
answer4967
viewsDoubt about factorial in C#
I’m trying to solve this repetition exercise: Make a go of starting a variable n (number) as 1 and factorial (result) as 1 and ranges n from 1 to 10. Code: int fatorial = 1; for (int n = 1; n <=…
c#asked 8 years, 3 months ago Gabriel Iasi 81 -
2
votes1
answer808
viewsASP.NET MVC and DDD
I am trying to use DDD and Fluent Api in a test application. I have the following question: I have a product register (in this case ink), when including a new product I put dropdownlist s, to force…
-
2
votes1
answer1058
viewsHow do I add more than two conditions to an Expression dynamically?
I need to pass a list of Expressions as a parameter and create the Ands in the most dynamic way possible. Just like that, whenever I add a new Expression on the list, I’m going to have to change the…