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
votes1
answer85
viewsHow to fill a scrollview with equal grids dynamically?
Guys, I’m trying to fill a grid divided into lines within a scrollview (to allow the user to view all content) with other grids. Each grid is within a line and contains the content of a schedule…
-
1
votes1
answer229
views -
1
votes2
answers71
viewsUse a Textfield to describe a path to save the files
Good morning guys, I’m trying to create a system that when I type a name in a textfield it would create a folder with this name and add the file inside the folder. The part of adding the file is…
-
1
votes1
answer142
viewsController search structure mvc 5
I have a normal application in mvc 5 and would like to change the basic folder convention for controllers/views. For example: /Controllers/Admin/Controller1.Cs /Controllers/Admin/Controller2.Cs and…
-
1
votes2
answers121
views2 Datagridview when clicking the first play the record in 2?
I’m using Winforms, I already have one Gridview populated, now I need that when the user double-click on a given line, he removes this record from the first grid and plays the same record on the…
-
1
votes2
answers69
viewsRecursive problem when integrating files
I am doing a recursive integration of several files,when running with only one file it integrates normal, but when I try to integrate several files it gives this error. {"An error occurred while…
-
1
votes1
answer103
viewsSocket Asynchronous C# receiving more than one message at a time
I am developing a C# Dll that works with Socket TCP Asynchronous for the development of some tools I am working on, the problem appears when the client receives many messages in a short period, in…
-
1
votes1
answer5127
viewsCorrect method to get Datatable populated Combobox value
What is the right way to get the value of a ComboBox populated by a DataTable? I’m using the following code: private void ComboBox3_SelectedIndexChanged(object sender, EventArgs e) { Consulta_cidade…
-
1
votes0
answers58
viewsWhat is the advantage of using C#Interface?
Is there a specific scenario for using Interfaces ? If so, how can I know when to use? I’ve always wanted to use in the projects I’ve been creating, but I never know the right time. I know that it…
-
1
votes1
answer152
viewsc# when pressed at the same time alt + F4 opens a new form
Good evening or good morning depending on where you live I was wondering if any of you could tell me how to open a new form when pressed at the same time alt + F4
-
1
votes1
answer356
viewsGeneric class for CRUD
I have some common CRUD features in the database, such as cadastrar, buscar um registro, buscar todos os registros and excluir. For this, I am currently implementing a manager class each database…
-
1
votes1
answer221
viewsEnable WPF C# Button through a function
I have a form to fill in some data through Textbox. I have a class that has some validation functions of fields name, password, user for example. And in my Code Behind just call the function that…
-
1
votes1
answer77
viewsBackgroundworker or Async
I need to develop a C# program where I will have slow processes. I have little experience with Winforms, I have more experience with WEB development. I am with the following doubt, the…
-
1
votes0
answers94
viewsDetect When user disconnects Socket TCP Asynchronous C#
I am developing an Asynchronous TCP server in C#, but not how to make my system detect that the user disconnected or was disconnected for some reason and perform a procedure for removing it from the…
-
1
votes1
answer60
viewsGiving Ctrl + f in webbrowser by code
They know some way to give Ctrl + f something by the code in an instance of Webbrowser?
-
1
votes1
answer122
viewsHow to embed a DLL into a winForms project
I need to incorporate a reference to a winforms project. I clicked on References, selected the reference and clicked on properties, then changed the property Embed Interop Types to true. When…
-
1
votes3
answers1710
viewsWhen and why should we use threads?
When and why should we use threads? I’d like a few examples.
-
1
votes1
answer50
viewsIsolatedstoragesetting in Windows Forms?
I’m used to using for Windows Phone, so: using System.IO.IsolatedStorage; public void putString(string key, string variable) { IsolatedStorageSettings iso =…
-
1
votes1
answer469
viewsWrite to the right line of the file and find parameters present in it?
I created the file: FileInfo arq = new FileInfo("C:\\ProgramData\\dataMinGSMFans"); if (arq.Exists == false) File.Create("C:\\ProgramData\\dataMinGSMFans").Close(); In a form I will see if it has…
-
1
votes1
answer2691
viewsSearch image in HTML code
In a form, I will perform an image search on Bing (in the background) so: titulo.Text = "sou doador" string minhaBusca = titulo.Text + " app"; minhaBusca = "http://www.bing.com/images/search?q=" +…
-
1
votes1
answer44
viewsCmd Builder similar to the look of All
Hello to everyone I would like to know how to do that when I click a button my program compile Cs files and more to make one . exe and run as the visual.
-
1
votes0
answers74
viewsDoes not align zeroed value to report c#
I have a report from Crystal Report C# on VS2015. In fields that are decimal when the value is reset the report exits with a blank space after the decimal places. When it’s not zero: | 100,00| When…
-
1
votes1
answer1665
viewsCreate truth table in C#
I have a test function that should receive different input combinations, to define these patterns I will use a truth table. However, I’m having difficulty generating the truth table, I made an…
-
1
votes2
answers337
viewsNo Entity Framework provider found for ADO.NET provider
I am splitting my application in layers, I installed the EF in the application layers and repository, in my view everything is correct, but I am having the following error: No Entity Framework…
-
1
votes1
answer759
viewsHow to make a label receive a text from the database
Hello I know the question is very simple, but I’m having a difficulty, I have a radio button and I would like his text to be received from an SQL Server database through a SELECT. I’m using the…
-
1
votes2
answers1886
viewsAssembly Microsoft.Owin not found
In my project I am using the OWIN library for user authentication. I already installed the package, but when I run the project I return the error: Could not load file or Assembly 'Microsoft.Owin,…
-
1
votes1
answer216
viewsHow to load Combobox in C#?
I have 2 Combobox: the 1st represents the provinces, the 2nd municipalities. When you click on Combobox 1 and select a province I want your municipalities to appear in Combobox 2.
-
1
votes1
answer212
viewsToast notifications c#
Hello, How can I use Azure to notify the user that you have new content in the app? I am creating a project on c# for Windows 10. Thanks in advance.
c# windows-phone windows-azure push-notification windows-10asked 8 years, 1 month ago Leandrolap 81 -
1
votes2
answers295
viewsMultiple device connections using Sockets
I have a method that connects to a card reader via TCP/Ip (ip, port) using Sockets. For the 1:1 connection is working, but now I need to connect to more than one device simultaneously. I would have…
-
1
votes1
answer722
viewsDns.Resolve() vs Dns.Gethostentry()
The method Resolve is as obsolete and Microsoft guides to use the GetHostEntry. However when using GetHostEntry the exception occurs: This host is not known When I use Resolve there is no exception…
-
1
votes2
answers296
viewsvalidation for Partialview
I have a page that calls a partialview formed by a div with text field inside it, through a button. Each time the button is pressed a line is added. The problem is that I cannot validate the empty…
-
1
votes1
answer1598
viewsHow to create a virtual keyboard?
I have a form (Form1) and when I click on a button I would like to see a new window with several buttons that when I click on one of them would add a letter to a Form1 textbox. Is it possible to do…
-
1
votes1
answer446
viewsHow to convert Json to Object where the column name is a variable number using Httpresponsemessage
I have the following Json: {"video":{"duration":"23:16","views":"2358","video_id":"1235288","rating":"5.00","ratings":"3","title":"titulo do…
-
1
votes2
answers4524
viewsHow do I switch between open windows?
I need to make the webdriver navigate between open windows. I’ve tried:this.chromeDriver.SwitchTo().Window(chromeDriver.WindowHandles.Last()); but I can’t use Last(). Are you missing any using?…
-
1
votes1
answer526
viewsIdentify if a particular program is the focus by C#
I am developing an application, which will insert data into another program (using Sendkeys, etc). For this I need to know if the program is what is in focus. For example: The application open the…
c#asked 8 years, 1 month ago Diego Moreno 491 -
1
votes1
answer809
viewsQuery using LINQ and Nhibernate
I need help in a query you should search for: PK_PARENT, NOME_PAI, {NOME_FILHO1, NOME_FILHO2, ..., NOME_FILHO*} For research I have already tried to do research in some ways like: var listaPai =…
-
1
votes2
answers125
viewsEdit Image in database when field is empty
I have a code that uploads image. In the database worked beautifully. Now I need to make a code that changes the image only when it is selected. That is, in my case, when I change a record, you must…
-
1
votes1
answer1277
viewsCombobox search only items that match the typed
In a User Registration Form, I have a combobox Civil Status Registry (which loads data from an SQL table), when writing to combobox the system needs to go searching the data and presenting only…
-
1
votes1
answer59
viewsWCF for consumption in Silverlight application (Windows Phone 8.0)
I’m having trouble adding to Servicereference, it adds normally but when it will generate the class "Client" it finds the following error: No endpoints compatible with Silverlight 3 Were found. The…
-
1
votes2
answers100
viewsI define a value in a class, when I instate the same value is another
This is the code where I defined a class Animal is a breeding method that asks the species of the animal and defines its state as alive: public class Animal { public bool estaVivo, usaDrogas =…
-
1
votes2
answers66
viewsHow to create a text file template?
How do I use an extension file template txt, in such a way that my program can read this template, replace specific points of it and generate an output, for example, in another file txt. For…
c#asked 8 years, 1 month ago Felipe Avelar 9,507 -
1
votes1
answer338
viewsHow to take a Domain Entity method to higher layers
Hello, I have the following domain entity. public class Cliente{ [Key] public string CPF{get; set;} public string Nome{get; set;} //Outras propriedades public void Sacar(Conta conta, decimal valor){…
-
1
votes2
answers355
viewsHow to reference HTML elements without ID in C# Windows Forms
Good night! I have the following code: <H3>Dados Cadastrais</H3> <table class='dados'> <tr> <th>Avalista:</th> <td>VINICIUS ALVES GONZALEZ</td>…
-
1
votes1
answer122
viewsView 3 Models in a View
I have 3 Models and I need to assemble 2 (two) lists and a "Save) button": Class: Tbproduct: public class TBProduto { [Key] public int TBPRODUTOID { get; set; } public string DSPRODUTO { get; set; }…
-
1
votes1
answer1167
viewsHow to disable editing and block adding Gridview lines
I have a GridView that the user enters with some information and saves, I would like that after clicking save. put all grid in mode ReadOnly and also would like to block to insert or delete lines.…
-
1
votes1
answer493
viewsRelationship Problem with EF6 (Relationship and Associative Class)
I need to know if my auto relationship and my associative class are created correctly according to the original model made in the SQL Server Diagram. Original Model - SQL Server My model in Power…
-
1
votes1
answer213
viewsHow to improve string comparison and concatenation C#
I have the following code: private static string MontarDescricaoOrgaoUoUe(RequisicaoFisica requisicao) { return !string.IsNullOrEmpty(MontarNomeOrgao(requisicao)) ? MontarNomeOrgao(requisicao) :…
-
1
votes0
answers175
viewsReportviewer Tablix and or Matrix Calculate value from a cell
I would like to know if I could calculate in Repbortviewer Tablix and Matrix a value from a result of another cell. Example: Cellula1 = 1; Cellula2 = 2; Cellula3 = Cellula1 + Cellula2;…
-
1
votes0
answers35
viewsAre there differences in the performance of variables implicitly and explicitly stated?
There are differences in performance of explicitly declared variables? List<int> lista = new List<int>(); And implicitly stated? var lista = new List<int>();…
-
1
votes1
answer168
viewsDynamic Linq Ordering using System.Linq.Dynamic
I’m trying to sort a list using the library System.Linq.Dynamic, follows the code excerpt: list = db.TABELA.Where(consulta.Colum + ".Contains(@0) ", consulta.filtro).OrderBy("@0 ",…