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
answer424
viewsAs time passes and progressbar grows change the label text
Before you start it’s just a game not a virus. My goal is when the progressbar reaches 1% put the text as downloading viruses and when it reaches 50% put the text as Installing virus but instead it…
-
1
votes1
answer131
viewsCustomer entity type is not part of the model for the current context
I’m trying to reproduce this example of Entityframework with default repository, as follows the link: https://msdn.microsoft.com/pt-br/library/dn630213.aspx But it is giving the error described in…
-
1
votes1
answer227
viewsWhen to instantiate the Icollection
I’m reviewing some programming approaches and falls into a dilemma with regards to where we should instantiate our navigation properties from EF ICollection. Many cases I see that the personal…
-
1
votes2
answers1505
viewsSearch file path C#?
I need to find a file path .wav in C#. I can find and execute the .wav with the complete path "c: caminhox...", however, I need the application to find the file in any directory that he is. I tried…
-
1
votes1
answer105
viewsEF mapping for tables with variable name
I have several tables with the same structure, but with different names. Ex.: CREATE TABLE `log_historico_25072016` ( `lhis_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `lhis_cvei_id` INT(10)…
-
1
votes1
answer196
viewsAdd the same with the click event
I have in my wpf code a listbox with the name "lstBox" (I left it invisible), and inside it a listBoxItem with a label and a textbox . Outside the listbox , in the same window I have a button " add…
-
1
votes3
answers178
viewsHow to store a single character?
My class has an attribute that is a single character. I can store as string, but I think the right thing would be char. Only this attribute can receive one int (between 0 and 9) another method. How…
-
1
votes1
answer51
viewsC# Form2 calling Form1
Good evening I am developing a product registration application, but I need to call form2 first than Form1. You could assist me in doing this?
-
1
votes1
answer69
viewsSubtract the current value from the previous one
I’m trying to make a supply system, I need it to take the last km registered in the bank of a specific vehicle and be subtracted by the new that will be inserted I’m trying to do so, but it shows no…
-
1
votes2
answers223
viewsScroll through buttons and text box with tab
Good afternoon everyone, inside windows form I put several text boxes and buttons, but when I navigate between with tab they are disordered, I know that if I do one by one will be in order, but it…
-
1
votes1
answer223
viewsHow to clean another Window textbox? - WPF
Follows code: MainWindow mainwindow = new MainWindow(); mainwindow.listbox1.Items.Clear(); // tentativa //mainwindow.listbox1.ItemsSource = null; I try to clean up listbox from another form...…
-
1
votes1
answer59
viewsHow to use a hyphenated parameter in an HTML Helper?
Hello I’m using the Data Annotation ASP.NET MVC in C#, but I’m not getting past ASP.NET data-toggle in the helper CheckBoxFor: @Html.CheckBoxFor(model => model.ReceberEmail, new { @class…
-
1
votes0
answers57
viewsCommunication between View and Controller via a script
I’m trying to call an Action through . ajax that runs inside a Modal button but apparently the url is not processed. My View is like this: @using (Html.BeginForm()) { <div…
-
1
votes2
answers672
viewsHow to pass a Ienumerable Model to a Controller?
I have a page that correctly lists my records. Plus I have a Html.BeginForm for each line, @model IEnumerable<Generico.Dominio.TB_POSSIBILIDADE> @{ ViewBag.Title = ""; } @if (Model.Count()…
-
1
votes2
answers81
viewsHow to restrict a set of a property?
I have the following property in my class: public char Naipe { get; set; } This property can only receive one of the following values: (char)9824 (Espada) (char)9827 (Paus) (char)9829 (Copas)…
-
1
votes3
answers510
viewsTake class property C#
People need to take all property of a class that is of class type. Ex: public class Pessoa{ public virtual int? Id { get; set; } public virtual MinhaClasse1 prop1{ get; set; } public virtual…
-
1
votes0
answers130
viewsProblems with Xamarin
I installed Xamarin in Microsoft Visual Studio Community 2015 and I’m trying to use it in Windows for cross-platform programming. But I came across a lot of bugs, I can not find any tutorial…
-
1
votes2
answers69
viewsText box to determine amount of digit usage
Below follows the code I am trying to limit the use of letters in the text box, the exception of the comma, but it occurs that the comma can be typed a hundred times, I would like the comma to be…
-
1
votes1
answer42
viewsDoubt with Handleerror Asp.net mvc
I am searching for a way to avoid an error message when user happens enters for a page that needs a parameter: namespace Projeto.WEB.Controllers { public class ModalidadeController : Controller { //…
-
1
votes1
answer494
viewsTreeview - click on Node and open specific screen
I have a TreeView, with some settings items: I would like to double click on one node it opens a specific form, the event of double-clicking and open the form, is OK, the problem is how I…
-
1
votes0
answers566
viewsHow to install Npgsql as a data provider for ADO.NET Entity Framework?
I’ve read everything you can imagine, but I’m out of luck. In Visual Studio 2015 Enterprise update 1, I followed exactly the steps as you describe the tutorial on the page…
-
1
votes2
answers4207
viewsCapture file name
I have a form that I search the path of a file in .mdb (Access database), however I wanted to know how I can limit and pick up exactly the string of the file between the last bar of the…
-
1
votes0
answers293
viewsC# Asp.Net.MVC - How to read Excell spreadsheets (xls and xlsx) using NPOI and generate a datatable?
I would like to read an Excel spreadsheet (XLS and XLSX) in my C#application, using the NPOI library and generate a Datatable. Since I’ve never used this library someone could provide me with a…
-
1
votes1
answer343
viewsMake global reference in C#
I am creating a simple database-free operations system in C#. It has 3 forms, being them: Login.Cs, Cadastro.Cs and Main.Cs. Also has the class Account.Cs, where operations are carried out. My…
-
1
votes1
answer229
viewsAre Xamarin Studio and Monodevelop the same IDE?
Hi, I’m going to start programming in C#, but I don’t want to use Visual Studio, so I searched and found another IDE, Monodevelop, but when I downloaded, for Windows 10, the site said to download…
-
1
votes3
answers3666
viewsConnect Mysql C#
I have a MYSQL bank in a shared UOLHOST hosting, I can connect to the bank by Visual Studio Server Explorer normally: But when trying to connect through a simple test console application I get…
-
1
votes2
answers922
viewsGenerate PDF in c# without using Microsoft.Office.Interop
Hello, I’m having trouble generating pdf without using Microsoft.Office.Interop. Other Dlls I found are not free. Someone has a tip?
-
1
votes0
answers521
viewsAutomate website browsing for software testing activities
I’m on a web systems development project, accessed by the browser. We are constantly making modifications in the operation of the processes and at each specific period we perform a test on the…
-
1
votes1
answer1489
viewsStart Thread with Input Parameters for Void Method
I try to initialize a Thread that has the function of processing a certain information by a method, so that the main execution line of the program continues running. But I need to pass two values…
-
1
votes1
answer160
viewsReturn with multiple json with jquery . net
I need to return to ajax a json, or rather several json, being city,neighborhood,state,parents, each being a json in the same method, however as not possible to make several return put the list of…
-
1
votes1
answer301
viewsDocument search screen with paging and search filter with Asp.net
I have the layout of a search screen, it has to show documents from my sqlserver database. To facilitate the search I put filter and as they are very documents it would be interesting to make…
-
1
votes0
answers94
viewsConvert . docx to pdf in c# without using Microsoft.Office.Interop
Hello, I’m having trouble converting a document into docx to pdf format without using Microsoft.Office.Interop. Other Dlls I found are not free. Someone has a tip?
-
1
votes1
answer63
viewsHelp on Printpage in c#
What are the processes to place a watermark (image) in the form that will be created by c# private void Imprimir_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { Font fonte =…
-
1
votes1
answer110
viewsProblem of reading and inserting data into DBF file after deletion of all records
I’m creating a system that will read a file xls, delete data from a file dbf to then include all records of the xls on the table. However, this system is an intermediate system, because the dbf are…
-
1
votes0
answers22
viewsImage in printDocument_PrintPage
How to insert image into a print form, type as in the case of icon there when I’m editing theform, the only way I ended up finding was through Image IMG = Image.FromFile(Application.StartupPath +…
-
1
votes1
answer218
viewsPrecision scaling using Entity Framework and SQL Server
There’s some time I’ve been noticing, something strange when saving values double in the SQL Server database with the Entity Framework. I noticed that when reporting a value ex: 12.23 after…
-
1
votes0
answers93
viewsASP.Net MVC - Draw in PDF file?
I’m creating a system in Asp.Net MVC and I need to create a scheme for the user to draw his signature in a.pdf file that is corresponding to a contract and I am looking for a way to do this but…
-
1
votes1
answer41
viewsGroupcontrol - Backcolor does not change
I’m using a GroupControl from Devexpress 16.1, but when trying to change the background color (backcolor) it still has the default color, does anyone know why? or if I’m doing it wrong? // //…
-
1
votes0
answers153
viewsSystem.Data.Sqlclient problem while upgrading to aspnet 5 core
I updated my entire project to aspnet 5 core because I was using dnx vnext and apparently everything worked fine, but I performed tests and noticed that some values were not correct and when…
-
1
votes1
answer167
viewsHow to get the "Base Address" of the main module of another process
Hello, I made a software that Analyzes the dump of a certain Engine process to extract the XOR key from the game automatically because it has a dynamic 16 bytes XOR changing from compilation to…
c#asked 8 years, 3 months ago Marcus André 140 -
1
votes0
answers49
viewsLoad database table by system session
I am developing an application, where one of the modules is the registration of products, and within this register, I have the tax part. In this fiscal part, I have to define an NCM, and according…
-
1
votes1
answer103
viewsFunction does not work with Usesubmitbehavior="False"
I own that button: <asp:Button ID="Button11" runat="server" Text="Cancelar" CssClass="btn btn-danger btn-block" OnClick="Button11_Click" OnClientClick="javascript:return confirm('Deseja cancelar…
-
1
votes0
answers139
viewsClient chat It is not possible to read data from the transport link:
Hello everyone is the following I made a Tc Pque server I already concluded, in the last days I have been doing the client but is giving the following error Cannot read data from transport link: A…
-
1
votes1
answer784
viewsProblems referencing a classlibrary from . net framework core - C#
I need to reference a class library . NET Core in my WPF layer which is a . NET Framework layer. However, a compilation error is made saying that it is not possible to refer to it. The error message…
-
1
votes1
answer457
viewsAsp.net and C# problem image gallery to display the photo
I’m having trouble displaying the photo in the browser the Repeater brings all the database information except the photo. I entered the data manually in the database. //TABLE CREATE TABLE…
-
1
votes2
answers108
viewsCreate Database using Fluent Nhibernate
Is there any way to create a new database directly from my application? I’m using Asp.Net MVC5 C#, Fluent Nhibernate and Postgresql. Note: I can already access my tables through the application,…
-
1
votes1
answer53
viewsMaintain a C# - Rest request
The doubt I have is more conceptual than in code. I have a Rest that is a server service, the same is done in C#, I would like every day at a specific time it would request a URL X. I thought of…
-
1
votes1
answer2211
viewsDifference between @Html.Labelfor and @Html.Displaynamefor
I am starting at ASP.NET MVC and taking a course where the teacher used to display the data of a different class methods to display a given. He uses the @Html.LabelFor and the @Html.DisplayNameFor.…
-
1
votes2
answers45
viewsSave user values to C#files
I am looking for some simple way to save user data to file in c#. In Java I always use the class Properties. I’m looking for something similar in C#, I already searched and found some answers but…
-
1
votes1
answer41
viewsWhat is the difference between Settings and Resource?
Settings saves user preferences for the color scheme of an application for example and the Resource is for the same thing ? When should I wear Settings and when to use Resource in the Winforms…
c#asked 6 years, 10 months ago Matheus Miranda 5,375