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
answer42
viewsFormsauthenticate + jQuery Ajax
I am creating an application that uses Formsauthenticate to log into the system. However, I would like to make a treatment so that in an ajax request (jquery) made when the user is not logged in. I…
-
0
votes1
answer237
viewsUpload Datagrid Image to Image
Variable x is associated with an image (blob field) that I loaded into a Datagrid from a Mysql database. DataRowView selectedRecord = (DataRowView)dataGridImagem.SelectedItem; var x=…
-
0
votes1
answer749
viewsApply CSS Style to Razor elements ex: Editorfor
How do I apply a style to all EditorFor of my View? Field example: @Html.EditorFor(model => model.Photo, new {htmlAttributes = new {@class = "form-control"}}) I tried to do it this way but I…
-
0
votes1
answer132
viewsDoubt with Webapi data insertion
I’m using the Postman: Error: "Undefined object reference for an object instance." I have the Controller Code: //http://localhost:1608/api/ApiGuiaCidade/cadastrar/cliente //"Referência de objeto não…
-
0
votes1
answer683
viewsHow can I set the width of each column in a Gridview?
How can I set the width of each column in one GridView in the following case below? <div style="width: 1000px; height: 400px; overflow: scroll"> <asp:GridView ID="Grid" runat="server"…
-
0
votes1
answer15
viewsValidating event with `?`operator
I was implementing a method to launch the event PropertyChanged of INotifyPropertyChanged. I did the validation of the event in a traditional way, ie with if (PropertyChanged != null). But the VS…
c#asked 7 years, 11 months ago Matheus Saraiva 2,157 -
0
votes2
answers1053
viewsPut a datepicker in a mvc 5 view with jquery or similar
I have this Razor in my view: <div class="form-group"> @*@Html.LabelFor(model => model.DT_AGENDAMENTO, htmlAttributes: new { @class = "control-label col-md-2" })*@ @Html.Label("Data de…
-
0
votes0
answers497
viewsPrevent page break in Microsoft Report
I created a report in Visual Studio 2015. Information is displayed correctly: However, when I click to visualize printing, it is cut (see that the information I painted is not appearing): How to…
-
0
votes1
answer68
viewsJobject.Parse returning null
I’m not very suited to Youtube Api V3. But I watched a google Developers live where the google operator shows how to list the activity of a particular channel. Based on that I executed via GET at…
-
0
votes1
answer1407
viewsLaunch a custom Exception
I have a method in my Webservice that throws an exception if the card code is already in use, that is, when trying to free the access the system checks if it is already in use and returns to…
-
0
votes1
answer140
viewsQuery with Linq to Entities in Many-to-Many relationship
I have the following tables in a database: The table Coursesprofessors joins the relationship Many-to-Many between the tables Courses and Teachers. I have been trying for a long time to do a query…
-
0
votes2
answers342
viewsHow to extract data from an XML url for Visual Studio Labels
[![Details of the question][1][1] I want to make a search button for the ISBN code using Virtual Studio 2013, in which he would return me data from the site ISBNDB.com in XML format, which would be…
-
0
votes0
answers32
viewsError loading partialView
I have a curious problem. I created a page that lists records and it has two links, one to delete and the other to display details. Both call for a modal. Each modal is a modal partialView. To…
-
0
votes0
answers57
viewsExecute string code in C#
I’m a C# beginner and I built a code inside a string and I need it to be executed. string MyString = "MyPictureBox.BackColor = Color.Red;"; I have found other similar questions (including apologies…
-
0
votes1
answer754
viewsC# - Limit value in Textbox
Hi, I’m wearing C#, and I’m having some trouble using a Textbox. I have a Textbox with this format: 192.168.100.1, to be more specific I’m putting IP numbers. I would like from the second . (100)…
-
0
votes1
answer112
viewserror when assigning a query to fill a reportview
can give me a template for a popular Rpt without DATASET? what I use is not working. , follows the model I use. private void Carregar() { DateTime dt1; dt1 = dtpickerInicial.Value; DateTime dt2; dt2…
-
0
votes0
answers52
viewsC# Drag and Drop without a specific event
I am developing an application in C#(WPF) and wonder if anyone knows how to get the data from drag n drop mouse without any event being fired. Is there any way to return this data from dragndrop…
-
0
votes2
answers974
viewsHow to make a datagridview C# sort a list (Ilist) by clicking on the grid header?
How to make a Datagridview C# sort a list (Ilist) by clicking on the grid header? For example, I have a list with three fields (id, name, city), when the user click on the column name, I want to…
-
0
votes1
answer1097
viewsHow to call the`Onclick` event in code Behind?
How can I call the event OnClick in the code behind of a dynamically created button? I’m trying it the way down, but I’m not getting it. void MontarHtml(List<DocumentoImagens> DocImagens) {…
-
0
votes3
answers406
viewsInsert decimal variable in Firebird
I am making an Insert in Firebird database in a Value field (decimal), but no decimals appear in the table. Code in C# : public decimal ValorUnitario { get; set; } produto.ValorUnitario =…
-
0
votes1
answer57
viewsChange column width Modern UI Metrochart for WPF
Good morning, everyone. I’m using the Metrochart (https://modernuicharts.codeplex.com/) for graphics generation, everything is working fine, however I would like to change the style of the columns /…
-
0
votes2
answers224
viewsDate Filtering - Month Verification 31 and February
I have the following code: Code example, must debug and follow the variable "lstItem" to understand its functioning using System; using System.Collections.Generic; using System.ComponentModel;…
-
0
votes1
answer788
viewsRunning a Method in the background Asp.Net/C# (Async or Thread)
What I needed to do was this Calling a Post Method Called Cadastrar Before this method finish I would call a new method called PessoaNotificacao However the method Registration would not wait for…
-
0
votes0
answers1327
viewsBematech - Non fiscal printer MP 4200 TH
I’m having problems with the non fiscal thermal printer in relation to the paper cut made by the guillotine. Let me give you an example: Today the printer is printing normal, but does not trigger…
-
0
votes0
answers46
viewsASP.NET MVC: Model Binding problem
I’m passing an object that has following property to Action: { ... Valor : "3500.00" } Financapessoalviewmodel: public class FinancaPessoalViewModel { ... public decimal Valor { get; set; } }…
-
0
votes1
answer122
viewsHow to use Linq2db.Firebird?
lowered the Linq2db.Firebird using the following code: Install-Package linq2db.Firebird The installation was performed successfully, but I am not able to find in Visual Studio, nothing related to…
-
0
votes0
answers86
viewsIs the Delphi binary to . txt conversion process very complex?
In a project I intend to create a tool that would automatically make a "translation" of a. dfm file from Delphi to a Winforms C#. The problem is, DFM editors do not always save files as readable…
-
0
votes2
answers404
viewsEquivalent to C# Java Form.Showdialog()
I’m starting now in Java, has a feature that I use a lot in C# that is NomeDaTela.ShowDialog();. I wanted to know a similar code that does the same thing in Java.
-
0
votes1
answer1064
viewsHow to create date file in iso string in name?
I’m having trouble creating a file with the following template: 2017-01-17T09:42:15.3419026-02:00_teste.txt When I run the application to create appears this message: No support for the given path…
-
0
votes1
answer89
viewsHow do I view an image hosted in my App?
I would like to display a promotional image within a PicutreBox in my app, but this image will vary according to the promotion that the Company will make. Is there any code that PictureBox show a…
-
0
votes1
answer189
viewsCreating reports with ASP.NET MVC and Angularjs
Man backend is with C#/MVC, in the frontend use Angular, I’ve reached a point in the project where I need to create reports. How to generate reports in a web environment? Which tool do you use?…
-
0
votes1
answer233
viewsChecbox Selected List View
I have a ListView where at the end I have a CheckBox referencing my data. I need to create a button that fires a method that traverses the Checkbox selected and take its value. How to do this…
-
0
votes1
answer139
viewsForm does not validate using Partial View
I’m using Partial View for registration of Pessoa, that is, in my View have two RadioButton: Pessoa Fisica and Pessoa Juridica, when selecting the Radio Button I’ll tell you what ajax: $(function ()…
-
0
votes1
answer421
viewsStart application through windows service
It is possible to start an . exe application on Windows Service c#? Something like: protected override void OnStart(string[] args) { Process.Start(@"C:\service.exe"); } protected override void…
-
0
votes0
answers231
viewsMulti-thread concurrency control
I need to develop a Windows Service with C# that checks a table in the database (Sql Server 2008). This table has the data I need and a Status field(Ready,Processing, Processed, Error). The service…
-
0
votes2
answers304
viewsHow to access an HTML page and return your HTML using Xamarin.Forms?
I would like to know how I can access a page, example Uol.com.br, and return your HTML. Along with this return try to use regular expressions with this HTML.
-
0
votes1
answer118
viewsMock Authentication on the dao
_usuario = CriaUsuario(new Login("Roberto"), new Senha("Senha")); var dao = new Mock<IUsuarioDao>(); dao.Setup(d => d.Autenticar(It.IsAny<Login>(),…
-
0
votes0
answers27
viewsError on some computers when trying to capture processor voltage by WMI
On only a few computers while running my hardware specification program it accuses an error on the 155 line. public static String voltage() { String Ic = String.Empty; foreach (var item in new…
-
0
votes1
answer150
viewsWeb Questionnaire App in ASP.NET Web Forms
I did some research and couldn’t find the correct term to correct my mistake. I created a Appweb where the user chooses a subject in a DropDownList and this loads a questionnaire from the database.…
-
0
votes1
answer346
viewsHow to take the Text of a Textbox in a Second Form and assign it to a String in the main form?
Well the goal is simple: assign the value of textBoxKey of password class in String keySimetric of class Acecrypt. But I don’t know how to receive and cast :( Class of password entry form. public…
c#asked 8 years, 11 months ago paccamicio 163 -
0
votes1
answer106
viewsTreatment of Datagridview
I have to present an object list in a Datagridview I am doing as follows: class EntradaModel { int codigo, motivo, anterior, quantidade; string observacao, tipo; DepositoModel deposito = new…
-
0
votes1
answer827
viewsJavascript call from within code Behind does not work
This is my job: <script type="text/javascript"> function montaDataSubstituicaoPrestador(dt_exclusao) { var arrData = dt_exclusao.split('/'); var exclusaoFormatada = arrData[1] + '-' +…
-
0
votes0
answers230
viewsPass xml as parameter to a proc is returning null
My xml may be wrong, of course. but since I’m not sure, I say: I need to pass a parameter via programming to a proc. As in my program is coming null, I decided to run directly manually first in…
-
0
votes1
answer46
viewsHow to put a test site running on the same server
I have my company’s website, and wanted to assign another project for testing without needing another server. It would be basically like this: www.meusite.com/projectThis/pagina1.cshtml that is,…
-
0
votes1
answer176
viewsHow to restrict formats in c#’s textbox
I’m new to programming and I have a very simple question. I am doing a practical work in college and in 4 textbox should be treated the consistencies of the notes and I wanted to restrict the…
-
0
votes0
answers546
views -
0
votes1
answer1329
viewsError publishing C# MVC project, Could not load file or Assembly 'System.Web.Http.Webhost
I have a C# MVC project, that running in Visual Studio 2013, works, but when I go up to the server gives this error: Could not load file or Assembly 'System.Web.Http.Webhost, Version=4.0.0.0,…
-
0
votes1
answer327
viewsI need to do a validation on the start date and end date with javascript
I need to do a validation on the start date and end date... So that the end date may not be less than the start date, but as I started messing with javascript less than two weeks ago I’m hitting…
-
0
votes1
answer24
viewsRender different Partialviews randomly
I have the following scenario: I have to move on to a view data from different tables (similar data, but without any relation), until then I got good. I created a class (viewmodel) that receives the…
-
0
votes1
answer75
viewsJarray add values
How to add a set of values JArray in an existing json. void adicionar(string name, string gamedir, string, lastVersionid, string javaArgs) { /* adiciona ao json existente... */ } Existing json…