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
votes2
answers1338
viewsMake Ubmit from a form via ajax
I have following code in my controller: [HttpGet] public ActionResult Mensagem(long idT, long idD) { string raaluno = acr.getAlunoLogado().ToString(); ViewBag.idT = idT.ToString(); ViewBag.idD =…
-
1
votes0
answers587
viewsReportviewer C# with parameters using Mysql
I’m starting to develop reports in Visual Studio 2013, using C# with Mysql. At the moment, I was able to make a report without parameters, but when I enter parameters in the query, it returns an…
-
1
votes0
answers333
viewsList with repeated records via Linq
I am trying to perform a simple query with LINQ, and the code below is returning me repeated records in the first 5 lines of the list. var teste = (from p in db.VW_PAGAMENTO_RECEBIDO where…
-
1
votes1
answer79
viewsGrab Control Not Typed in View Typed
I need to take the page post the elements that I’m not creating from the model, for example the input with the id "type". How can I catch him in the process ActionResult the elements are not created…
-
1
votes1
answer1484
viewsApply filter to Datagrid populated with List without changing the Datasource
It is possible to apply filter to a DataGridView which is "filled" with a List, without altering the DataSource grid? Example: When I have a grid that uses a BindingSource I can apply a filter, like…
-
1
votes0
answers101
viewsMark PDF text with C#
I have an application where some names will be searched in a given PDF file. When finding the name I should mark the words found with a "text tag". Does anyone know a library that can do that? I’m…
-
1
votes2
answers78
views -
1
votes1
answer779
viewsXamarin Forms - Plot GPS route
Good evening! Does anyone have an example of how to use GPS in Xamarin? I’m developing a project (PCL), which would plot the route between two points, but I’m still having some doubts. I can trace…
-
1
votes1
answer319
viewsproperty with Crystal Reports Objects List
I have the following classes: public class objeto1 { public string Descricao {get;set;} public List<objeto2> Objeto2 {get;set} } public class objeto2 { public string Descricao {get;set} public…
-
1
votes1
answer92
viewsMigrations error c# MVC
I created a Finance Drive Controller, but when I click on the menu to list returns the error: Invalid Object name 'dbo. Move'. Why did that name stick? It was supposed to be Movimentacoes. PS: I…
-
1
votes0
answers164
viewsAjax error null return value
I have a function in ajax: $.ajax({ type: "POST", url: "@Url.Action("FiltraLevatamento", "Consulta")", data: JSON.stringify(jsn), contentType: "application/json", dataType: "json", async: true,…
-
1
votes1
answer204
viewsSeparate items from a string using Regex
I need to separate the items of a string in an array using C# and Regex, could help me? The string is as follows: required|email|min:2|max:255 There are some rules I wanted to suit: Separate main…
-
1
votes1
answer571
viewsAsp.NET MVC checkbox list bind with string value
I have a checkbox list and need to bind values that are strings (@item.Selectedvalue) with my Ienumerable>. <div class="editor-field perfil-filtro-expander-todasAcoes"> <div class="metro…
-
1
votes1
answer111
viewsHow to determine the time at which a background task will be performed
I am programming for Windows 10, and at a certain time in a day I want my background task to be faced. Here is my registration code: on the home screen: var trigger = new…
-
1
votes1
answer52
viewsPage/website manipulation, Windows Phone Silverlight C#?
I see several apps on Windows Phone, which manipulate a site, are usually apps of the sites themselves, such as Tecmundo. It captures elements of the site and adds within the elements of the app,…
-
1
votes1
answer195
viewsSelect two attributes from two different tables in a view
I have the model (superclass) Pessoa and the model Aluno public partial class Pessoa { public Pessoa() { this.Escola = new HashSet<Escola>(); } [Key] public int PessoaID { get; set; } public…
-
1
votes1
answer63
viewsChange the culture of Monthcalendar
It is possible to change the object’s date format MonthCalendar from a Winforms application? It occurs that the crop selected at a customer’s station is Polish and this is causing error in handling…
-
1
votes2
answers73
viewsHow do you get the time zeroes out?
I am using a Label to receive the time of a video. The time I receive from the video is a double which comes in milliseconds, for example: 1555 = 1,555 sec. When I convert to TimeSpanthe label…
c# winforms visual-studio-2015 type-conversion conversionasked 8 years, 3 months ago Caio Henrique Nespolo 45 -
1
votes0
answers390
viewsReturn Json from an Object List - WCF C# . NET VS 2010
Hello, I want to return a list of objects in json by wcf. When I put to return the string, it returns peacefully. However, when I return the list, the error. The error that shows is an error by…
-
1
votes0
answers848
viewsUpdate cell value in Datagridview in C#
Hello! When clicking a button, I need you to update the value of a cell in the datagridview. follows the code I tried but didn’t work. private void btnAcesso_Click(object sender, EventArgs e) {…
-
1
votes1
answer78
viewsEntity Framework 6 relationship
I have a class where I need to have two different relationships with the same table. public class Usuario { public int Naturalidade {set;get;} public int CidadeEndereco {set;get; } public class…
-
1
votes0
answers327
viewsconnection via socket server android, client c#, server within another network
I was able to do the communication C# -> Android without problems, but when Android connects to a local network, I do not know how to make this connection via ip, since it acquires the local IP.…
-
1
votes1
answer126
viewsFluent Mapping API 1:N cascateado
How to Model a Relationship of 1:N, where, 1 user may have several requests, and in this request we have reference to another entity? Ex: public class Usuario { public int UsuarioId { get; set; }…
-
1
votes1
answer301
viewsIncreasing the size of a string
It is possible to increase the size of a string in the code? string sIdentComanda = ""; if (objComandaParametro.ComandaParametros[0].IsControlaNrComanda) { sIdentComanda += " Comanda: " + nrComanda;…
-
1
votes2
answers9722
viewsSquare root C#
Boas, After the tips of the users I decided to improve my C# code of the calculator. I think it’s simpler but I have a little problem in the square root because I try to do the math and the result…
c#asked 8 years, 3 months ago ChrisAdler 1 -
1
votes1
answer830
viewsLog errors with Selenium Webdrive in C#
Good night! I’m organizing my test suite and looking for the best ways to create a bug report when a test fails. I’ve already implemented a log in. txt with the test name that runs (using…
-
1
votes0
answers88
viewsHow do one form affect another form in C#?
I’m creating a project that will have certain settings like notifications. These notifications when chosen to appear on the taskbar will affect other Rms. Because the system is a call center when an…
-
1
votes1
answer1756
viewsPOST and GET methods in C#
I would like to know if you have any library or any third party component that do the POST and GET on the websites. I need to navigate some sites but I can not do GET nor on the home page of a…
-
1
votes0
answers541
viewsPDF in ASP.Net c#
I need to display a PDF file that will be on my server or bank (I haven’t decided yet) on a web page, made in ASP.Net C#. The problem is that this file has to be all "blocked". The user cannot…
-
1
votes1
answer987
viewsProgram Stopped Responding - c# Windows Form
I’m doing a c# program that basically queries (large) a Mysql database. When I run the program via Visual Studio, everything goes perfectly. But when I do it by the executable, when the button that…
-
1
votes1
answer2060
viewsGrab the application folder
I have an application with all interfaces and features. In the same project I put a simple code running on console to check if there is already a database created on the machine. If not, he must…
-
1
votes0
answers1001
viewsimport methods from an unmanaged Bematech DLL c#
I need to use a dll provided by Bematech with functionalities of a non fiscal printer. The example they provided brings the following code: [DllImport("MP2032.dll")] public static extern int…
-
1
votes2
answers152
viewsUnity 5 error apparently code
I was playing this game when this problem came up Assets/Sampleassets/2D/Scripts/Platformer2dusercontrol.Cs(2,25): error CS0234: The type or namespace name CrossPlatformInput' does not exist in the…
-
1
votes1
answer159
viewsLinq function does not return List
Hello, I have an application and it does not return a list I select via Linq-to-Sql The error may be in the SELECT that Linq-to-sql is doing. SELECT [Extent1].[Codigo] AS [Codigo],…
-
1
votes1
answer116
viewsHow to use the Npgsql reference for framework versions smaller than 4.5?
Well, I made an application by Visual Studio 2015, in Windows 7. However, the application will be used in the future, also in Windows XP. The problem is that there is a reference…
-
1
votes1
answer300
viewsAutomatically open my program c#
Good, I created a program to convert some file formats. Now in windows, I put by default, that whenever I click 2x on *.csr file open my program. How do I program, whenever the user opens a *.csr…
-
1
votes1
answer199
viewsProblems with Fluentnhibernate in hosting
I have developed a website in c# that is still in the testing phase, using . Netframework 4.0 and MVC 4 I’m using Nhibernate and Fluentnhibernate to map my entities. The site works perfectly on any…
c#asked 9 years, 1 month ago Programmer 11 -
1
votes1
answer514
viewsHow do I Autodetect firefox with Selenium webdriver in c# (Visual Studio)
I need to select the Autodetect before running my Firefox profile script, because in the browser’s network settings is coming how to use system settings. That way I can’t even open the system. I…
-
1
votes3
answers163
viewsViewdata is not displaying message
I’m trying to send a message from Controller to View using Viewdata, but it’s not displaying the message. When I click on the "Check" button of the View it is to call the method Verificar() from…
-
1
votes3
answers726
viewsHow to identify a key in Textbox?
I would like to create an event that would only be started when the user pressed "Enter" inside the Textbox, but how do I identify when the user pressed this key ?
-
1
votes2
answers1274
viewsCompare properties of an object with properties of a list
I have a method: public void MetodoAleatorio(List<RequisicaoFisicaDTO> lstRequisicaoFisicaDtos) { RequisicaoFisicaDTO requisicao = lstRequisicaoFisicaDtos.FirstOrDefault(); } Where I get a…
-
1
votes1
answer32
viewsWhat are the errors in this code using EF6?
What are the errors or inappropriate practices in this code? static void Main(string[] args) { using (var db = new AccountingSystemContainer()) { var invHeader = db.InvoiceHeaderSet.Create(); var…
-
1
votes1
answer125
viewsCoordinate in MVC map
I need to show a map to the user and allow him to choose a location. After choosing the location I need to return the GPS coordinates (Latitude, Longitude) to the action. What’s the best way to do…
-
1
votes3
answers2971
views -
1
votes1
answer78
viewsCRUD error with . NET MVC
I am trying to recover some data from my database but is giving the following error Specified key was Too long; max key length is 767 bytes I have no idea what’s going on. User class public class…
-
1
votes0
answers209
viewsProblem with Httpwebresponse. Does not answer
I hope you can help me, I have a problem when I try to see c# make a request on my server ( the request is slow, takes about 10 minutes to be processed and returned ) For quick requests everything…
-
1
votes3
answers897
viewsC# hangfire stopping
I’m using hangfire with IIS in an Asp.net MVC application with C#. I have a Task running every 5 minutes, but the application is stopping. This occurs in a variable time period, sometimes runs for 3…
-
1
votes1
answer469
viewsHow to configure Context to put table name in plural in en-BR?
I am in an ASP.net MVC 5 application, configuring a class DbContext. When the EF generates the database, the tables referring to the application objects are getting the names in the plural in…
-
1
votes1
answer183
viewsCapture datagrid id
If I want to capture the value of the column ID of the selected row, I need to necessarily use the wind SelectionChanged, what is to be triggered at each line exchange on the datagrid? Or just with…
-
1
votes1
answer42
viewsDoubts about the use of class
Good morning, you guys. How are you? I am writing a windowsform application, and in some situations I need to make several queries, Insert and delete.. well, so I created a query class, a delete…