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
-
3
votes1
answer2956
viewsIs web tax printer possible?
I am implementing a system for issuing a invoice with tax printer in C#, but I would like to know if it is possible via the web using Javascript HTML, CSS etc. How would I do that? Through what…
-
3
votes3
answers140
viewsSort images by height of each one
I have a list of images with different dimensions. I wanted the images to be sorted from the smallest to the largest: the one that has height the minor was first and the height longer last. Using…
-
3
votes2
answers2309
views'Data Access Layer' is the same as 'Data Access Object'?
I’ve always used DAO (Data Access Object) in Java Web and now I’m leaving for the platform. NET (C#), I saw that there is the DAL layer (Data Access Layer). I was confused, the DAL would be the same…
-
3
votes3
answers590
viewsCombobox in Databases
I always used Delphi and there had with component called DBLookupcombobox where it was possible to list the data of a table and use the field ID save in the main table, for example: In an employee…
-
3
votes1
answer257
viewsManipulate String C#
I have strings that come so: "Cadastro,Novo" "Cadastro,Editar" "Cadastro,Excluir" "Cadastro,Morfar" "Cadastro,Etc" "Entidade,Novo" "Entidade,Editar" "Entidade,Excluir" "Entidade,Morfar"…
-
3
votes1
answer195
viewsWhat is the size and coordinate measurement difference in C#Forms
In my project I work with the distance of elements and their size. But on a screen, 600 by 600, when inserting an object, 100 by 100, it appears to be much smaller than 1/6 of the screen, and when…
-
3
votes2
answers569
viewsRelationships in Viewmodel with EF
I am developing a project where a user will have several data. To not extend the class I thought to separate by categories. Example of classes: User Data Dadosfamily Etc.. To do this on the site I…
-
3
votes1
answer237
viewsVallidationsummary shows no error on screen
I am using Validationsummary in Forms, but these are not being rendered. Is there any known reason for this error? Form example: @using (Html.BeginForm("CadastrarPessoaFisica", "Usuario",…
-
3
votes1
answer101
viewsIs it possible to use Session in Windows Service?
I have an application in Windows Service, and I need to save the state while a certain method is running, which is the best way to do this?
-
3
votes1
answer1363
viewsHow to load Datatable on a Datagrid?
I have a DataTable loaded with information in a WPF application. I’d like to take that DataTable and carry it on a DataGrid. How can I do this the easy way ? DataGrid in the XAML: <Grid>…
-
3
votes1
answer171
viewsController Edit - Entering Values
My method responsible for editing is inserting values in the table CONSUL_EnciclopediasCONSUL_Promocoesinstead of editing. Therefore, if I have the options x with id=1 and y id=2 within the course…
-
3
votes1
answer65
viewsWhat is System.Void type
Until then I believed that void was just a keyword to indicate a no return method, but then I found System.Void on MSDN. This changes something?
-
3
votes3
answers230
viewsSQL Query export for excel
Good, I’m having some difficulties in the result of a query. To fit you is the following, I have a registration application of "unavailability." and I need the following: Every day I have to extract…
-
3
votes3
answers462
viewsJSON serialization and deserialization in desktop application
{"result":[[{"code reduced":"019076-3","Stock":200,"Price":900.77,"Price":225.19,"Description":" ASUS AMD RADEON R5 VIDEO CARD 230 1GB DDR3 64BITS R5230-SL-1GD3-L *IMP","Group":"VIDEO…
-
3
votes2
answers479
viewsLogin to a web site by the program
I have a site programmed in PHP with login and I’m making a desktop application (Windows) and I’m trying to log in to it from these system on the web. My system in PHP works as follows: it creates a…
-
3
votes1
answer264
viewsRelational model in Firebird with C#
Developing a small C# project with Visual Studio, Firebird bank and ibexpert. With the tables WITHOUT RELATIONSHIP I can perform everything well. But I need to relate CLIENTE 1:N with BONUS And…
-
3
votes0
answers421
viewsError importing Nfse Service from Aracaju
I’m trying to add this service in VS 2013: https://www3.webiss.com.br/aracajuse_wsnfse/NfseServices.svc But it is not possible to add this URL as a service. Normally the URL’s I add do not have the…
-
3
votes2
answers1101
viewsDistinct in the Plains does not work
I did this Illumination on my model: public static List<MontaArvoreAcao> CriarListaArvoreAcao() { RupturaEntities db = new RupturaEntities(); var _listaUnidade = ( from r in db.Ruptura join a…
-
3
votes1
answer485
viewsUpload system with rotate image automatically as in windows 8.1 or facebook
Today when viewing an image in windows 8.1 even if the image is lying down it automatically understands and shows correctly, in windows 7 appears the picture lying down. When sending this image to…
-
3
votes2
answers479
viewsAdding checkbox to datagrid lines
I have an application in WPF, where there is a window with a datagrid with multiple lines, having only records. In this window there is also a button and I need the user, when clicking the button,…
-
3
votes2
answers544
viewsGrab custom tags with Html Agility Pack
I’m using the plugin Html Agility Pack to manipulate html And I would like him to capture my elements that use tag customized I tried it this way: HtmlDocument html = new HtmlDocument();…
-
3
votes1
answer408
viewsVar inside the FOR when starting at 0(zero) Count should be Count-1?
I picked up a system at the company where I work for another colleague. I note that all FOR’s are like this: for(int i = 0; i < lista.count; i++) { //meu código } I learned that when a variable…
-
3
votes3
answers4129
viewsDirectory problems
I am trying to read a file . html but I cannot get the path of this file. I have already used Environment.GetCurrentDirectory and Directory.GetCurrentDirectory but did not succeed. Below follows…
-
3
votes1
answer151
viewsEntity Framework - N to N, clear list
public class Aluno { public int AlunoID { get; set; } public virtual ICollection<Turma> Turmas { get; set; } } public class Turma { public int TurmaID { get; set; } public virtual…
-
3
votes1
answer783
viewsAccess Denied when saving image to an application
I made a Silverlight app that captures image using web cam. The application works perfectly however when I save the captured image generates the following error: File Operation not permitted. Access…
-
3
votes1
answer624
viewsReload page with MVC
I made a function in the model and the call in the controller. Then, I go to jquery and the write command in the BD is successfully executed. It turns out, when I finish recording, the screen…
-
3
votes1
answer78
viewsWhen do I have to unsubscribe (unsubscribe) events?
One question on the same subject has a reply what it says: You don’t have to desubscribe from an Event when the instance that is subscribing has the same Scope as the instance that is being…
-
3
votes2
answers201
viewsHow do I return an existing item in my enumerable via Contains?
I have an enumerable, and I intend to query through a code per parameter. if the enumerable "Contains" Code, then it will return to me all items that are with this Code. See I was trying to do it…
-
3
votes1
answer85
viewsQuestion Area with Time
I am developing an application that should provide an environment where the following functions are executed: Administrator - Cadastra questions - Edits user - View responses - View evidence - I…
-
3
votes3
answers606
viewsCorrect Inheritance in Entity Framework
I have a mother class DadosClientes and two child classes DadosClientesPF, and DadosClientesPJ. Instance DadosCliente has the field: Nome, Telefone Instance DadosClientePF has the field: CPF…
-
3
votes2
answers1925
viewsHow to count how many uppercase characters are in a string?
How to count how many uppercase characters are in a string?
c#asked 9 years, 6 months ago Leandro Belo 113 -
3
votes4
answers1604
viewsAccess javascript variable in template loop
I am creating an Asp.Net MVC project and found a problem in View. See the code: <script> var data = []; for (var i = 0; i < '@(Model.Count())'; i++) { data[i] = { "source":…
-
3
votes1
answer824
viewsAudit with Entity Framework
I am wanting to do the audit tables of my entities. At first I thought to overwrite the method SaveChanges. I also thought of writing a method that will be doing the audit on my repository base.…
-
3
votes1
answer71
viewsReplace words dynamically
For example, I have file addresses: C:/windows/x.exe C:/windwos/system32/example.exe I would like to replace the file name and extension with "", so: C:/Windows/ C:/windows/system32/…
c#asked 9 years, 5 months ago João Paulo Pulga 431 -
3
votes2
answers429
viewsRun N threads and know when all finished running
I have the following problem, I need to run the same method N times in a for and know when all the threads they’ve finished running it. I needed something like this: foreach (MeuObjeto obj in…
-
3
votes2
answers83
viewsTagging photo with problem
I made a code to label a jpg, writing in the footer of the image the address of the customer’s website. The Problem: Some photos the text is coming giant as if it was 72px font instead of 12px font…
-
3
votes3
answers331
viewsFind which items have been marked - Help with logic
I have 4 Checkbox, which when selected will assign their values in a variable. The result will be saved in only one field in the BD. When loading these Checkbox, I need to make an account to know…
-
3
votes1
answer369
viewsFirst letter of menu underlined for shortcut - WPF
I am trying to put a shortcut on my system menu in WPF. In Windows form, just change the text property by putting the "&" before, but in WPF does not use "text" but "content" Somebody help me?…
-
3
votes1
answer502
viewsHow do you get a piece of an image?
Based on this image how would be the code to separate in, as if it were sub image without splitting this image into different files: Ex: void splitImage(int numeroDeDivisoes, ref Image original, out…
-
3
votes1
answer63
viewsHow to check value in enumerator with [Flags]?
I have my enumerator: [Flags] public enum EConta { Receber = 1, Pagar = 2, Cobrada = 3, Atrazada = 4 } and have the assignment EConta conta = EConta.Receber | EConta.Pagar; var retorno =…
-
3
votes1
answer850
viewsDDD - What is the best option (Layer) to consume an external Webservice?
Pattern DDD. I need to consume one Webservice external, treat the return of that Webservice and return the result through the layer of Application. It would be interesting to consume this Webservice…
-
3
votes1
answer102
viewsOndisconnected event in Signair does not work right
Guys, I’ve developed a chat accordingly with this link and it all worked out well. But the Disconnected event doesn’t work right. What happens is that, according to the reference link, this event is…
-
3
votes1
answer157
viewsData overriding onClick command
Guys, I have a little problem in Asp.net webforms. And I made a nice pie. I know the solution to this might be a little simple, but I’m confused. Follows the code: public partial class Default :…
-
3
votes3
answers13033
viewsSplit to separate part of a string considers first separator
I have the following text:: _2910_0908_401 _600_ERV__P_119552_GUARITA ERV WITHOUT POWER RADIO INOPERAN_TE SEMAFOROS P TRENS AND VEICLS APAGADOS_PSG TRAIN C FLAG SIGNAL BY GUAR_ITA there use the…
-
3
votes1
answer1205
viewsHow to make a batch file run a Console Application by passing parameter?
I have a Console Application that method main of Program.Cs (where the application starts) receives a input. Follows code below: static void Main(string[] args) { var input = Console.ReadLine();…
-
3
votes2
answers188
viewsHow can I have a Radio Group with 10 radio Buttons divided into 2 columns and 5 rows?
How is it possible to do this? I tried with table row, but that takes away the properties of the radio group. I wanted it to stay that way:…
-
3
votes1
answer759
viewsError making order with Secure Paging API
When trying to create the payment, I get the following error. I am using the following package: https://www.nuget.org/packages/Uol.PagSeguro Additional information: For security reasons, the DTD is…
-
3
votes2
answers111
viewsAuto Publication Wordpress c#
I want a C# application to post on a Wordpress blog. The post title would be the variable value title and the article would be the variable html. How do I get that? Note: Console project.…
-
3
votes2
answers1016
views -
3
votes1
answer727
viewsLearn Asp.net without dominating c#?
basic doubt. I want to start programming for the web with Asp.net mvc, but I know very, very little c#, just the basics of the language. Would it be a bad deal to start with Asp.net and get the…