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
answer45
viewsVariable error in Identity
Good afternoon guys, I am supporting a project of my company, which is being used the config Identity. in this I added your deleted call variable in my database and gave an update-database and…
-
0
votes1
answer303
viewsInstantiate a class that inherits an interface class
I have a class that inherits many interface classes, and I want to instantiate it to use only one method, how do I do? It is possible to do without passing all the necessary parameters? public class…
-
0
votes1
answer558
viewsLine breaks in table cells ASP.NET MVC C#
How to do not break in multiple rows the columns of a <table>, because I put a scroll and would like to leave the grid cells without breaking, and rather let the user use the scroll. View…
-
0
votes1
answer206
viewsPick up information using a dropdownlist as select
I need to make a basic supply system, where when selecting the type of fuel, it brings me the last registered value of that product and automatically select and still automatically insert in Textbox…
-
0
votes1
answer171
viewsHow to put class information in an array?
To save lines of code, I do the following: PictureBox[] pic = { pictureBox1, pictureBox2, pictureBox3, pictureBox4, pictureBox5, pictureBox6, pictureBox7, pictureBox8 }; And I have a class called…
-
0
votes1
answer239
viewsCheck checked item
I have the following code inside the Itemchecked event: private void lsvRecebeGrupoLayout_ItemChecked(object sender, ItemCheckedEventArgs e) { Layout lay = new Layout(); GrupoLayout grupo = new…
-
0
votes2
answers470
viewsC# MVC solution does not run Javascript on IIS
I have a C# solution where I use MVC. I have a View for product items. In this view I have a Droplist as specified below: Drop List <div class="form-group"> @Html.LabelFor(model =>…
-
0
votes4
answers1289
viewsHow to write a Datetimepicker to the database
Hello, I have a form with the Datetimepicker - Short (only the date). And in the database I put DataEntrada DATE My problem is, I created an insertion method but I don’t know how to pass the…
-
0
votes0
answers118
viewsRelationship 1:1 with abstract class in EF
All right, guys? I have the following problem: I have two classes Person and Property who may have an address (Address), but the class Person may have 0:N Address and the Property 0:1. Knowing that…
-
0
votes1
answer56
viewsError when registering in the form
When you select the value and I will register informs me an error. System.Argumentexception: The value "System.Object[]" is not of type "Blogweb.Models.Compra" and cannot be used in this Generic…
-
0
votes0
answers94
viewsSend form with file using ajax web api Entity framework
I’m trying to send a file along with the form to the database, but when I send it returns me error 400 bad request, I don’t understand why. Curriculoscontroller // POST: api/Curriculos…
-
0
votes1
answer92
viewsModal Bootstrap cannot pick up variable
Dear friends, good morning! I am starting and catching up on my first opportunity as a rsrs programmer In Minhasvendas2.aspx I have <div id="myModal" class="modal fade"> <div…
-
0
votes1
answer100
viewsHow to return a list of each chapter?
Follows text file: @MATEUS (1) 1 Livro da genealogia de Jesus Cristo, filho de Davi, filho de Abraão. 2 A Abraão nasceu Isaque; a Isaque nasceu Jacó; a Jacó nasceram Judá e seus irmãos; 3 a Judá…
c#asked 7 years, 1 month ago Matheus Miranda 5,375 -
0
votes1
answer57
viewsWhy does the one-to-many relationship in the Entity Framework by default not work?
[Table(name: "cliente", Schema = "estudo")] public class Cliente : Base { [Key, Column("COD_CLIENTE")] [Required] public override Int64 Id { get; set; } [Column("CLI_NOME")] [Required] public…
-
0
votes1
answer213
viewsPopular List c#
I’m trying to return data from a list in a foreach. In the first foreach, it is returning the correct data, but it is not recording in the nflist variable of the first foreach, so as soon as it…
-
0
votes0
answers247
viewsWhen sending a notification, how do I show the badge icon?
This is the Oncreate from my Mainactivity. Note that I have a badge with a value of 10 for testing. Now I need to make sure that by submitting a Notification, I can increment the badge icon with the…
-
0
votes2
answers978
viewsHow do I click the java script Alert ok via Webbrowser?
How can I disable all javascript alerts via web browser ? When I’m loading the page. <link rel="stylesheet" href="css/bootstrap-theme.min.css"> <meta charset="UTF-8"> <!-- Latest…
-
0
votes1
answer1486
viewsTLS 1.2 CT-e 3.0 and NF-e 4.0 protocol
I am developing CT-e 3.0 and NF-e 4.0, in the same cites the need to change the security protocol from SSL to TLS 1.2 with the deadline of 02/04/2018. In the reception webservice has no information…
-
0
votes0
answers183
viewsHow to set value in a Textarea field using webbrowser?
I am trying to set a value in a Textarea type field using webbrowser, but it is not being set the value. I’ve tried it like this; webBrowser.Document.GetElementsByTagName("p")[2].InnerHtml = texto;…
-
0
votes0
answers217
viewsError opening aspnet page C#. Could not load file or Assembly 'Microsoft.ReportViewer.Common, Version=12.0.0.0
Good evening, everyone. I have developed a website, which on a given page shows a report. Locally it works normally, but when I run on the published page, it gives the error: Server Error in '/'…
-
0
votes0
answers31
viewsHow to display a single chart slice without repeating
I have a table called Itenslib. This table I keep the items of a sale. In this table, I made a sum for Profit and Total. The problem is that, for example, the sale with this ID:100030087 it has 5…
-
0
votes1
answer1557
viewsSend parameters to Restfull services
I have a web application mvc and in it I have an action that should pass a parameter to a REST service. How do I pass a parameter to a REST service. I know that I will have to implement an Httppost,…
-
0
votes2
answers77
viewsError trying to save combobox and Masktextbox
I have a form with two fields: 1 Combobox I put the type of people (Physics or Legal); 1 Masktextbox with CPF; At first I don’t know what’s better if I keep the value of Index of the combobox or its…
-
0
votes1
answer573
viewsASP . NET MVC - Using a @Html.Dropdownlist for two Actionresult
Hello, I’m developing an application with ASP . NET MVC and using the Epplus API for XLS export. In the View of an equipment report I have two @Html.Dropdownlist with Type of Equipment and Status…
-
0
votes1
answer41
viewsapi result different from my site result
I created a C# API in Azure where it returns me an array by passing the following parameters:…
-
0
votes1
answer821
viewsGet row and column item from a dynamic html table
Good morning guys, I’ve set up a dynamic html table with information from an SQL table. In the following structure: This table has a filter field of the agencies listed code: <script> function…
-
0
votes1
answer587
viewsDatetime field problem in POST ASP.NET MVC
Field Datetime getting 01/01/0001 00:00:00, and not with the date before the POST. Datatime Field with Dataannotations (MODEL) [Required(ErrorMessage = "Campo Data de cadastro é obrigatório.")]…
-
0
votes0
answers284
viewsHow to delete registry with modal?
I have been dealing with ASP.NET for some time and I have come across a problem that I cannot solve. The idea is only to open a modal window, click on the confirmation and delete a record. The idea…
-
0
votes0
answers136
viewsdbContext static with Entity Framework: Compensates or not?
Guys, I use Entity Framework and Code First to manage my data access, and I’m thinking of working with a single instance, static and global of my Databasecontext. But I have two questions: What…
-
0
votes1
answer738
viewsHow to return a Datareader C#
I know I’m doing it wrong. But I would like to know if it is possible within what I am trying to return a dataReader. See, I created a class called client that has the method "Searcher" the same has…
-
0
votes1
answer287
viewsLoad Combobox with concatenated string
Code that loads the comboBox: private void frmAdicionarProdutos_Load(object sender, EventArgs e) { this.Load += new System.EventHandler(this.frmAdicionarProdutos_Load); string serverName =…
-
0
votes1
answer56
viewsService stopped working when generating the chart
I was having trouble generating a graph, which is solved. The code below was ok and suddenly stopped, IE, the service is not running on account do not know what. At the time I call the Getservice…
-
0
votes2
answers1357
viewsMulti threads c#
I would like to create a program to act multiple threads in a process, making it faster, that is, the threads working together to finish the service faster. But each one works individually in the…
-
0
votes1
answer323
viewsCall Get action that returns a view by jquery ASP.NET MVC
I need to open the create view by clicking a button, how to do this by Jquery? Knob <div class="col-md-3"> <button id="btnNovo" class="btn btn-info form-control" style="width: 200px">…
-
0
votes1
answer168
viewsCreate a list with a Model and an Int in C#
I have the following class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Dynamic; namespace Model { class PromocaoQtdeVendidaModel { private int…
-
0
votes1
answer41
viewsRescue button through id
Good night, I’m developing a graph, academic work.. .. The idea is to make a "maze", so I go the same at runtime, and I keep a "reference" of each button in a list, but I got to a point where I need…
-
0
votes1
answer27
viewsPrintpreviewdialog in the browser
I have the following code in a MVC project inside a cshtml: var w = window.open('', "print", "height=400,width=600"); w.document.write(json.html); w.document.close(); w.setTimeout(w.print, 1000); It…
-
0
votes1
answer49
viewsLink line of txt file with selected in my chelistbox
my code brings inside a checklistbox the contents of a txt file. Each line of that file (it is also a line in my checklistbox) is the contents of a variable that I will exchange in a Word document.…
-
0
votes1
answer505
viewsObject initialization can be simplified
After having made some updates to the nuget(18) packages, I went to compile my project and this error occurs: Object initialization can be simplified It points to those files in my code.…
-
0
votes1
answer136
viewsnet. 4.6.1 reference error for . netStandart 2.0
I’m having a problem referencing a Standart2.0 project to my api . net Framework 461; occurs the following have the class: public class MeuReturn : IHttpActionResult { private readonly string…
-
0
votes1
answer91
viewsHow to manipulate data inside pages using tabcontrol
Good Tare. I have a tabcontrol with two pages, I think we can say so, on page 1 I have a datagridview that in column[0] brings numbers of notes, and on page 2 I have a txtbox that I want to be…
c#asked 7 years ago Junior Guerreiro 617 -
0
votes1
answer218
viewsDeclare Entity Framework Relationship one for many
I have two classes: Person public class Pessoa { public int Codigo { get; set; } public string Nome { get; set; } .... public virtual ICollection<Endereco> Endereco { get; set; } } Address…
-
0
votes1
answer325
viewsSort a list of objects by a string list
I’d like to serve Getall already brought the list of posts in order according to the list of Ids passed by the parameter module. Higlights List<Post> posts = new List<Post>(); var posts…
-
0
votes1
answer43
viewsGet link from an image saved in the bd
I am developing an ASP.NET MVC project using c#. I have a page with a facebook share button. The sharing button is already working, however I’m having problems because of the image tag, because it…
-
0
votes1
answer514
viewsListbox - Multiply values and move to another Listbox
I have 2 Listbox. When I pass a value to the other Listbox opens a screen to enter the amount I want of that product. That said, it will take the quantity * value and show in the other Listbox. Code…
-
0
votes2
answers64
viewsCellclick event, does not return Datetime value
I’m recording some data on DataGridView and in the Event CellClick should fill in the DateTimePicker with the value already registered, but I’m doing something wrong. Buttons: record, edit, delete…
-
0
votes1
answer195
viewsReport from a form with no database
My question is, can I generate a report (I don’t know if I can call it that): Report: Date of payment Client: xxxxxx xxx xxx xxxx Payment date: xx/xx/xxxx Signing It would be a very simple layout…
-
0
votes1
answer288
viewsIs it possible to define an HTML tag in a C#string?
I have the following string written in C#: string Descricao = "Você ficou muito tempo inativo, e por isso sua sessão caiu. Retorne para a página inicial para continuar." I would like to put the…
-
0
votes1
answer64
viewsSocket Whitelist IP accepted connection C#
I am trying to make a Socket system (Server -> <- Client), however I want to make an ip Whitelist that can be accepted in the client connection to the server, but I do not know how, short I…
-
0
votes2
answers138
viewsC# conversion error
I have the most generic class Account and another ContaPoupaça who inherits from that class Conta. In this daughter I have an interface called ITributavel, because this class beyond the methods and…