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
-
0
votes0
answers34
viewsHow to generate a setup in visual studio 2012?
I’m having trouble generating a setup at Visual Studio 2012. I don’t see the option to generate setup, tried to create a setup with Inno Setup, created normally but when installing on the machine…
c#asked 7 years, 6 months ago António Mateta 159 -
0
votes1
answer435
viewsBlock alphabetical sorting in Datagridview
My Datagridview receives product data from a database. They are: description, unit price and quantity. I programmatically added a subtotal column and added the * quantity unit price calculation. As…
-
0
votes1
answer32
viewsmodelBuilder add only one variable with different varchar
On my system, I have a small code that adds varchar to all variables added in the database modelBuilder.Properties<string>() .Configure(p => p.HasMaxLength(150)); only that I need only one…
-
0
votes1
answer35
viewsGridviewcheckboxcolumn generating a blank column
I’m creating a form like Radcontrols Winforms Application to make a simple registration of people . In this form I am using the Telerik Rad Controls To use the checkbox for each item in the list I…
-
0
votes1
answer68
viewsSwap operator + for - in refactored method
The Code below has the goal of making a move on an object on the Y axis of an object following the mouse (the code works), see that the code within the if and of else if are equal except by the…
-
0
votes1
answer150
viewsString returning empty
I am trying to get me into the . zip file, select a single file called mcmod.info and save for a MemoryStream temporary. I followed as a basis that link on Stackoverflow, but when I read the var ms…
-
0
votes2
answers60
viewsGenerate Quence for Field
It is possible for me to create a quence without changing the field to id? Id(x => x.Id).GeneratedBy.Identity(); Map(x => x.DocumentoNumero); Using this example, I would like to keep a quence…
-
0
votes2
answers169
viewsHide menu on login screen C#
I have a little problem, I need to hide a menu on the login screen when it is loaded. I used a solution that works locally, but on the server does not happen, follow below: //MENU QUE FICA NA MASTER…
-
0
votes1
answer301
viewsReturn date x days left to arrive
Scenario: Ciclos id name endDate (datetime?) Dice: 1, primeiro, 05/10/2017 2, segundo, 15/10/2017 3, terceiro, 20/10/2017 4, quarto, 30/10/2017 With Line and lambda, I would like to return the dates…
-
0
votes1
answer150
viewsIntegrating Webservice C# with android
I have a C# Web Service but I can’t consume it on Android. Follows the Code of android and the LogCat. //----------------------------- Conectando a Base WS class asynProjeto extends…
-
0
votes2
answers433
viewsBad request on a new iis server
I have 3 servers in production and homologation everything works ok. But on a new server I just created, install all the tools necessary to run Asp.net and put the source code of a web service in c#…
-
0
votes1
answer47
viewsHow to have a result mixing checkbox'es?
How can I combine results of checkbox? With 5 checkbox, for example, how I make the result be combined for when the user selects the 5 and the 3 appears a messenger box. Ps: If the question is…
-
0
votes2
answers189
viewsAsp.Net Dropdownlist tooltip or title with JS
I’m starting in Javascript, and would like my DropDownList of a control .ascx, when selecting an item, display its full value when you hover over it, as if it were a tooltip or title. This is my…
-
0
votes3
answers780
viewsHow to send dynamically created fields via JSON?
How to send via JSON fields input dynamically created, for example: The user type in a text field number 4 and the function creates 8 input fields, or type 5 and the function creates 10 input…
-
0
votes1
answer78
viewsDoubt with public class Listatbproductodto : List<tbProdutDTO> what is it for?
I have this DTO class: using System; using System.Collections.Generic; using System.Linq; using System.Web; public class tbProdutoDTO { public tbProdutoDTO() { this.dsDescricao = "";…
-
0
votes2
answers487
viewsInvisible speakers in Listview
I have a listview with a series of columns, but I’d like to hide a few, how do I do that?
-
0
votes2
answers539
viewsError Windows cannot find 'svcutil.exe'
Among the many projects here in the company, there is one that when I compile gives the following error: Windows cannot find 'svcutil.exe' What do I do to fix that mistake? This is the version of my…
-
0
votes1
answer301
viewsGradient Xamarin Forms
I’m making the screens of a Xamarin app with XAML, and wanted to put a background gradient is possible ? For now the code is this:
-
0
votes1
answer930
viewsPrinting Datagridview C#
I need to print the selected columns in a Datagridview. I can not generate image, because there are many columns (15 in all) and not all appear on the screen. I can make the impression in landscape…
-
0
votes1
answer177
viewsLog in with the Facebook user
How do I do a c# or Razor routine on my site, so instead of the guy just by logging in the page, have the option to log in by the facebook user? I’m not asking for code ready, just how I do it.…
-
0
votes2
answers1454
viewsapply filter in return from a list
I’m making an appointment where I have one array of situations ex: 1, 2, 3 in the query I have to filter through these situations, follow my code. var array = GetSituacoes(); var lista = bll.Query(p…
c# entity-framework linq lambda-expressions linq-to-entitiesasked 7 years, 6 months ago Thiago Ubiratan 353 -
0
votes1
answer90
viewsWhy doesn’t it work on my user control?
I have a code that would like to put it in the user control of my windows Forms, but it does not make changes to Form1, what is the reason? Code: private void button5_Click(object sender, EventArgs…
-
0
votes1
answer541
viewsPass data from one gridview to another gridview
I have a datagridview1 that searches the database for the data and shows the information, I want to click the add button to take the selected line in the first datagridview1 and move to another…
c#asked 7 years, 6 months ago Danillo Victtor 539 -
0
votes2
answers52
viewsHelp with Windowsforms
I’m having a hard time showing it on Form. I have a main form (fmrPrincipal) and another form for registering a client (fmrCadastraClient). Inside fmrPrincipal has a menu with the "Client" field and…
-
0
votes0
answers27
viewsRemove Row from table and adjust Ids
Greetings. I’m a beginner in the database and wanted to know the correct way to remove an item from the table and update the identification number of the others. This is the typical novice problem,…
-
0
votes2
answers793
viewsSave XML from a List
I am developing a C# Console Application that loads a List and then writes an XML file with the contents of this List. Class public class Equipamento { public int Id { get; set; } public string…
-
0
votes2
answers19039
viewsCreate an executable
Good morning, I made an application in C# recently but it’s still only in code form and I needed to create an executable ! But I’ve never done it, I don’t know how. Can anyone help ? Thank you !…
-
0
votes0
answers191
views -
0
votes1
answer775
viewsMVC - How to load a template html page, modify it and send it by email
I am making a form that sends an email to the customer, this email comes from a template depending on the client’s stage. Ex: Estágio 01 envio o e-mail com a body vindo do modelo_01.html, se o…
-
0
votes1
answer3671
viewsstring was not recognized as a Valid datetime
Hello. This problem is occurring only when I place the site on iis. I have tried several solutions, however, I can not solve.Below the code snippet where the problem occurs: public DataTable…
-
0
votes2
answers1339
viewsField check Combobox, Textbox Maskedtextbox
How to create a method to check that all "Combobox, Textbox Maskedtextbox" fields are filled in? Mine does not work public bool CampoVazio() { bool ok = false; foreach(Control ctrl in this.Controls)…
-
0
votes1
answer60
viewsValidation with ASP MVC
Personal I am in trouble, precise that the attribute code (from my database) has either have position greater than 4 numbers and with attribute value can not contain value less than 0. I tried to…
-
0
votes1
answer82
viewsManipulating what will be displayed in the Displaymember of a Checklistbox
I have a Model class: class pessoaModel { int id; DateTime data; TimeSpan hora; CliModel ID_Cliente = new CliModel (); public string Nome { get { return nome; } set { nome = value; } } public int ID…
-
0
votes1
answer97
viewsDialog messages launched from Viewmodel through Dialogcoordinator
I came across a problem working on a WPF project where I use "MVVM Light Toolkit" and "Mahapps.Metro". I am trying to take advantage of the "Dialogcoordinator" feature provided by "Mahapps.Metro" to…
-
0
votes1
answer67
viewsHow to stop a windows Forms application until a form is closed?
I want when Form1 is opened, the whole program stops, and only comes back when it is closed. How can I do this? Code that opens Form1: if (x == DialogResult.Yes) { Form1 f1 = new Form1(); f1.Show();…
-
0
votes1
answer683
viewsC# Return Value of a Thread
I created a database connection class that I intend to use Thread to make queries faster. In office ExecutarSelect and ExecutarSQLPiece I have returns, but I couldn’t get those returns through the…
-
0
votes1
answer162
viewsUpdate Label of a Window through the Contents of a Usercontrol Combobox
I have : A Window: Window1 (Mainwindow) Three Usercontrols: -Usercontrol1 -Usercontrol2 -Usercontrol3 In window 1 I have a label (label1) and in each of the Usercontrols I have a Combobox. Each…
-
0
votes1
answer203
viewsDifferentiate list of items shown in the View using "Individual User Account" Asp.Net MVC 5
I don’t have much practice in programming and am creating a system of registering items like movies, books, games, etc. for a college job. The problem is that I need to use a user manager system so…
-
0
votes0
answers488
viewsConsuming WEB API ASP.NET MVC 4 [ERROR]
I have a problem... I put my web api in Ocaweb... But if I use the link in the project, it does not work and returns me "Statuscode: 500, Reasonphrase: 'Internal Server Error', Version: 1.1,…
-
0
votes1
answer924
viewsIdentity implementation in existing project - Not working
I have a project for a virtual store. The store already exists today made in ASP and I’m migrating to .net. I intend to use the authentication control itself . net, but when I started the project, I…
-
0
votes1
answer64
viewsHow to use SQL LIKE
I’m trying to assemble a string that makes a filter to compare only a piece of a numbering. I tried to make an appeal and looked for several ways to do it and so far I could not. using…
-
0
votes1
answer73
viewsHow to make the computer choose between two Characters
Guys, I’m doing an old game in winforms in C#, however, I have a problem, is the following with me pressing the first button I want the computer to choose between "O" or "X", I tried to use the…
-
0
votes1
answer77
viewsHow to fill out INPI data in a . NET project
My question is somewhat conceptual. My company registered the software in the INPI and received protocol data, etc. How to fill this data in my system? I noticed that in the file AssemblyInfo.cs i…
-
0
votes1
answer349
viewsMulti-user authentication with ASP.NET MVC and . NET 4.5
I am developing a system where there is a need for two types of users, the client, which will access only the frontend, and the administrator, associated with the backoffice. I need these users to…
-
0
votes1
answer1431
viewsHOW TO MAKE A Getasync in an ASP.NET API by passing an object as a parameter?
I would like to know how to send an object as a parameter to an API made in ASP.NET and return data by the same way? I understand that the simple method of a Get is: HttpClient cliente = new…
-
0
votes1
answer356
viewsVisual Heritage of Windows Form
I am making a base form with all the components I need to perform a CRUD, and for example, when I create the customer registration form, I will inherit the base class and so show up all the basic…
-
0
votes0
answers28
viewsI copied a form and code from one program to another in c# only it doesn’t work
My program was giving directory error, so I created another project in Visual Studio, I copied and pasted the form and the code in it, only the code no longer corresponds to the form, you know if…
c#asked 7 years, 5 months ago Pedro Nogueira 1 -
0
votes1
answer63
viewsHow do I make the imag map link a parameter from the database?
I would like that in the imag map area tag in the href attribute instead of placing the page link I want you to receive a parameter that is sent to a c method#. HTML code <img…
-
0
votes0
answers167
viewsFirebird error with Entity Framework and C#
I’m trying to use Firebird with Entity Framework in C#, but when I create relationships and try to give Update-Database in Migration gives this error: Type is not resolved for member…
-
0
votes1
answer290
viewsPublish Asp.NET MVC website?
I developed a site in ASP.NET MVC and now I want to publish it on my provider using FTP. I’ve done all the FTP configuration on Publish of the 2013 VS I’m using. When do I publish the Controllers,…