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
votes1
answer103
viewsError searching by name Access ASP.NET C#
I have an error searching by name(value entered by user) in the access database he says that the values in the inside of the parameters are null. Follow the code. Person.Cs responsible for the logic…
-
0
votes1
answer731
viewsHow to put Character limit in Text (script)
I would like to limit the text that appears to the user... Inputfield for the user to write the text ,and make the final text receive the text from Inputfield... (wanted to add reticence ( ... ) at…
-
0
votes1
answer1314
viewsHow to know if there is content in a class object?
I need to know if I have content in a class or if it’s empty, how do I get that information? Classe usuario = new Classe(); I wish I could consult if there’s content in this class of mine usuario.…
-
0
votes1
answer233
viewsHow to use the Google Maps API on a Windows Form in c#?
I’m having trouble with how to do that. My TCC has a tab where there are some addresses (Label), where, when clicking, I want the address to appear in Maps. I’ve thought about using Webbrowser, but…
-
0
votes1
answer1684
viewsMaking Codefirst Error in Enityframework
That’s the mistake that’s happening: An unhandled Exception of type 'System.Typeinitializationexception' occurred in Entityframework.dll Additional information: O…
-
0
votes1
answer378
viewsDownload Files by web link C#
would like to deploy on a system I’m making an option to download the files over the web, by pre-defined cloud links that I have. However, I am not managing to implement this. Can you help me??…
-
0
votes1
answer24
viewsUpload video files with Angularjs
I have a page where I upload the image files, pdf, xml, etc. On this page, I now need to upload video files too, I searched on some sites but I did not find examples of how to do, when I try to…
-
0
votes1
answer207
viewsScreen capture/screenshot button in Xamarin
I am developing an App and I need it to take a screenshot, but not by the standard procedure (home button + power), but by a button inserted on the screen. The button has already been created and is…
-
0
votes1
answer43
viewsChecking a radiobutton
Good morning ! I created a small system that uses some radio button components, but when I do not mark any the system generates an error, someone knows how can I make a conference call if some radio…
-
0
votes1
answer447
viewsAccess Combobox Selecteditem Windows Forms C#
I put the items inside the combobox as follows: cmbSituacao.DisplayMember = "Text"; cmbSituacao.ValueMember = "Value"; cmbSituacao.Items.Add(new {Text = "TODOS", Value = "000000"}); foreach(var sit…
-
0
votes0
answers26
viewsJquery.Ajax() in Webforms without Static method
Is it possible to run a codebehind void method without them being Static? I’m getting error return 500 when trying.
-
0
votes1
answer98
viewsC# List Console
How do I display only the third values of the list, in case the ("500, 900, 2000, 1500, 2000). And how I do this same process to display only the third values of the list that has associated the…
-
0
votes1
answer245
viewsIs it possible to make a Repeater line not repeat ? c#
Is it possible to make a Repeater line not repeat ? Or to bind a few lines of the FooterTemplate of Repeater ? I need the last line I tried to put on Footertemplate not to repeat, because it’s the…
-
0
votes1
answer108
viewsAdd images in the bd using classes in c#
i am doing a project that has classes, for example, a User class, where you have :code, name, password and photo and you have the user input method: public string Inserir() { return "insert into…
-
0
votes1
answer332
viewsHow to make an Event Change in ASP.NET Core MVC?
In ASP.NET we have the Event Change right in the Code Be-hind protected void ddlCiclo_SelectedIndexChanged(object sender, EventArgs e) { //algo aqui } What would be the equivalent in ASP.NET Core…
-
0
votes0
answers48
viewsField rounding value in sql write with c#
I have a problem to record a decimal field(18,2) in the sql database, I am passing the value of 11.5, and this recording in the database 12,00. I am working in Decimal fields(18,2). How can I solve…
c#asked 6 years, 4 months ago Junior Guerreiro 617 -
0
votes1
answer103
viewsHow to make Asp.Net MVC application stop logging out, and stay logged in direct?
I developed an application in Asp.Net MVC and this application when the login is done and spends time without moving, when I will register, the system asks to log in again, I would like to know how…
-
0
votes1
answer84
viewsProblem with Combobox - Systemdatarowview
I have a problem. My software has an order registration screen and in it there are some Combo Box that pull certain information according to what is selected in the Product (Cake, Candy or Cupcake)…
-
0
votes1
answer165
viewsClear Datagridview without firing Cellvalidating event
I am trying to clean a Datagridview from C#. However when executing Rows.Clear(), before that he is running an event CellValidating which is also attached to Datagridview You can not perform the…
-
0
votes1
answer68
viewsPages . aspx in View folder in ASP.MVC project
Good afternoon, everyone, I am a beginner in MVC architecture and I have a question about an ASPNET.MVC. I wonder if it is possible in the "View" folder of the project, to put an "aspx" page along…
-
0
votes2
answers1736
viewsPartial View does not load Javascript - Asp.Net MVC
I’m switching to a Partial View via a two-parameter controller, music and artist. Already in PV I pass to the function fetchLetra() that is in the file letraAPI.js these parameters for the return of…
-
0
votes1
answer335
viewsCreating a Dropdownlist
I’m using Asp.net-mvc-5, and wanted to know how to create a Dropdownlist without being in this pattern here: <div id="conteudoEscolha"> @Html.DropDownList("", null, htmlAttributes: new {…
-
0
votes0
answers33
viewsform does not upload file
I have a form that I need to upload to an ftp. When I put the fashion down no file loads. <form id="frmEnviar" name="frmEnviar" data-ajax="false" method="post" runat="server"…
-
0
votes1
answer43
viewsConversion of Types with Fluenti API to EF Core 2.1
I would like to know if it is possible to make the following conversion: public class Pessoa { public bool Ativo { get; set; } } public class PessoaMap: IEntityTypeConfiguration<Pessoa> {…
c# asp.net-mvc asp.net-core code-first entity-framework-coreasked 6 years, 3 months ago Nicola Bogar 123 -
0
votes2
answers314
viewsHow to restore a database backup from a c#application?
I have searched how to restore a backup of BD through a c#application, but I had difficulty understanding the logic. I have already programmed a form that performs the backup and have no idea how a…
-
0
votes3
answers1182
viewsSeparate a string in C#
I’m working with C# and I want to know, please, how do I separate the contents of a q file contains the following information: There are 30 calories in Pumpkin (1 cup). There are 83 calories in…
-
0
votes2
answers146
viewsC# - Datagridview does not change Defaultcellstyle.Backcolor property sent from a class to Form
I have a question in C# regarding Datagridview. In this scenario I have a Form where I run a Datagrid bringing information from another class. After the data is loaded by Datagrid.Datasource the…
-
0
votes1
answer975
viewsError while saving file - Already being used by another process
I want to read the text of Textbox (Winforms) and save to the file. Giving error, saying that the file is being used in another location. StreamWriter escreverentrada = new…
-
0
votes1
answer518
viewsHow to Replace Characters with Other with C#
For example: 4587 / 1235 / 7554 And then replaced 4587;1235;7554 Remove the spaces and in place of the bar, put point and comma, as it does in C#?
-
0
votes1
answer52
viewsSelectionbrush property with only edge and no padding
It is possible to make the property SelectionBrush same as the image below: 'Cause she’s like this now: Follows code: <TextBox SelectionBrush="Red" FontSize="12pt"/> I want it only the border…
-
0
votes1
answer218
viewsWait with Alertdialog()
good! My problem is with the AlertDialog asynchronous of Xamarin.Android. I have a class with a method that assembles an alert with some fields... With the data of these fields, I assemble an object…
-
0
votes1
answer43
viewsRemove all elements from the list without the Clean() method, is there a way?
For example I wanted to remove the elements from the list in this way: public class List : MonoBehaviour { List<string> inventário = new List<string>(); void Start () { for(int i =…
-
0
votes1
answer786
viewsError Saving Data - Nullreferenceexception: Object Reference not set to an instance of an Object
I am trying to save data which pulls a list of a Ienumerable, however while always saving from the error below. When consulting the database, the data were saved correcting, but always give the…
-
0
votes3
answers431
viewsUpload Datagridview photo and move to picturebox - Windows Forms C#
This is Good Afternoon Guys! I have a little difficulty in passing my registered photo to my PictureBox to update the registry. My scenario is this:: I have a Form data entry registration and A Form…
-
0
votes3
answers283
viewsHow to break line after 29 digits C#?
How do I make every 29 digits the line break? var hs = hs_codes.Text; var texto = new StringBuilder(hs.Length); var digito = true; foreach(var chr in hs) { if (char.IsDigit(chr)) { if (!digito)…
-
0
votes2
answers107
viewsCode-First Fluent API with complex classes in ASP.NET Core 2.1
Error while performing the Add-Migration when using Complextype classes. public class Cliente : EntityBase { public Cliente() { #region Create HashSet Properties Lists Dependences Titulares = new…
c# asp.net asp.net-core fluent-api entity-framework-coreasked 6 years, 3 months ago Nicola Bogar 123 -
0
votes1
answer47
viewsHow to pass a parameter to Dataprpetyname (in Datagrid) C#
How can I pass a parameter there? For example change the id_inss to id_example? I couldn’t find a way.…
-
0
votes0
answers115
viewsProblems with layout in previous versions of android Xamarin Cross Platform
I am compiling the application in the marshmallow version 6.0 and open everything right. But, when compiling in some previous versions (for example in version 5.0.2 Lollipop and 4.4.2 Kitkat), the…
-
0
votes1
answer82
viewsHow to change dll from Reference with running application?
I have a project where I need to use a reference with different versions in a single execution, example: Switch System.Drawing version 2.0.0 to System.Drawing version 1.0.0 It’s possible to do that?…
-
0
votes1
answer43
viewsReplace Line in string
I’m creating a C# application using Replace(), i can replace a specific word by another in the entire file, but I wonder if there is a way to do this replace in just one specific line. I want the…
-
0
votes2
answers76
viewsPost-comma replacement in C#
Guys I’m using Visual Studio 2015 and would like and would like to replace a text for after the second comma. If the ID is equal (in case 501) it replaces the translation after 2° (and before 3°)…
c#asked 6 years, 3 months ago Luiz Nascimento 81 -
0
votes1
answer746
viewsControl 'Contentplaceholder1_name' of type 'Textbox' must be inserted in a format tag with runat=server
I’m doing a job for the college, a Forms web application on Asp.net C#. I have a problem and until then everything was going well, but suddenly it is giving this mistake. I searched some related…
-
0
votes1
answer382
viewsOpen Webcam and capture image with C# in ASP.NET Webforms
all right? I am developing a student registration system and I need to open the computer webcam to take a photo of the student and link in their registration, I would like to know how it is possible…
-
0
votes0
answers67
viewsEF Core - Map dynamic columns to a list
I need help in mapping EF Core entities. I have table products and this table can contain different columns depending on customer customization, they will always be text columns. I have a table and…
c# .net entity-framework entity-framework-coreasked 6 years, 3 months ago Eduardo Abreu dos Santos 152 -
0
votes0
answers23
viewsProblem between controls that are above what generates Mouse Enter and Leave event
Good night to you all. There is a control panel in which triggers events when the mouse enters and leaves your region. However, there are also other controls and these are on the panel itself, not…
c#asked 6 years, 3 months ago Victor Hugo Pongolino 83 -
0
votes1
answer74
viewsHow to force use the float method instead of the double method?
How to force use the float method instead of the double method? public static void Dividir(double dividendo, double divisor) {…
c#asked 6 years, 3 months ago Amadeu Antunes 3,331 -
0
votes0
answers34
viewsRestsharp canceling the operation
Good afternoon, I have an application that via Restsharp I make a call on the Revenue Service to retrieve the information I need. However, as I use a third-party service, we do not know when this…
-
0
votes1
answer281
viewsWhen testing my web API C# ASP.NET locally on Fiddler it returns an error 404
I am creating a stock control system with integration of android app,the connection is being made through a Web Service API. However I can not test the methods that exist in it to see the returned…
-
0
votes2
answers228
viewsJson Web Token - How to create a token that accesses only a particular Controller or Action?
I am implementing JWT in a. Net Core 2.0 application and would like to know how to restrict token access to certain controllers.
-
0
votes1
answer57
viewsI have a method in Serverside validaNIF and want to call it through javascript (Clientside) to validate an Asp:textbox when it does Leave
I tried to do through the event ontextchange and call the backend function, only as this is to make a record, whenever it ran the event wipes the data from my other textboxs (it seems to refresh the…