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
answer729
viewsEntity delete table and your relationships
Is there any way to delete a table record and all your relationships at once? because I currently delete each related record before deleting the main record, and it takes a long time, for example I…
-
0
votes1
answer473
viewsPass Combobox Value to Parameter
I am developing a solution in C# Windows Forms and I’m having doubts about how to take one of my combo box options that is activated when a checked is clicked. This Combo has the option of yes and…
c#asked 7 years, 1 month ago user92218 -
0
votes1
answer1057
viewsWrite CSV file in a certain line passed by parameter c#
How to write in a CSV file, in a certain line I will receive by parameter, example of the beginning of the code: public void EscreverCSV(string caminho, int linha, string mensagemErro) { using…
-
0
votes0
answers41
viewsinsert and update date values in DB using a makedtextbox C#
Hello, while I was developing a system to manage the records in DB error is happening that when entering the values the data records become empty and when trying to update the information listing it…
-
0
votes0
answers58
viewsData Conversion
I am making a program and I would like to know how to save a field that contains only characters, but send to the bank only your code? I am using two tables to save the data and the field I want to…
-
0
votes1
answer43
viewsError when executing select with alias
When executing the query below using "AT" in place of "T" as alias of Join is returned the following error: "Ierrorinfo.Getdescription failed with E_FAIL(0x80004005)." OleDbDataAdapter da = new…
-
0
votes0
answers158
viewsCreating routes (controller/id/action) in c#
I’m trying to create a very specific route on a page of my project. As usual, routes on . NET are controller/action/id but on a specific page I would like it to be controller/id/action. What I got…
-
0
votes1
answer497
viewsData type Mismatch in criteria Expression + Excel data handling
Check to see if the logic is consistent, please. The procedure of this code is: Consult a procedure and store her data in a DataTable: private DataTable ExportPerformanceEntrega() { try {…
-
0
votes0
answers166
viewsCreate an object instance by Activator.Createinstancefrom C#
I need to instantiate the Paismapper class with the following scenario. DLL running: Projeto.ERP.Desktop In Formuláriopal I execute the method…
-
0
votes1
answer259
viewsCreation of Foreignkey
Well, in my project I decided to use some Foreign Keys. And after getting this error : {"The INSERT statement conflicted with the FOREIGN KEY Constraint "Fk_dbo.Setors_dbo.Areas_setorareas ". The…
-
0
votes1
answer44
viewsWindows service sharing information with a Rest
Is it possible for a Windows Service to exchange information with a Web Service Rest? If so, is that good practice or not? Why the question? This is what I need to do. When a flag in the bank is…
-
0
votes1
answer739
viewsEntity Framework List
I am created to action of Edit to edit my data models. What happens is I use Viewmodel to "join" several models in a. Okay, I can get the data from models who are not List<>, that is, the…
-
0
votes1
answer43
viewsOverload Error C#
I am experiencing the following CS0123 error No Overload for 'lsvRecebeGrupoLayout_ItemCheck' Matches delegate 'Itemcheckeventhandler' in the code below, any suggestions what might be causing this…
c#asked 7 years, 1 month ago user92218 -
0
votes1
answer52
viewsCreating C# method, where do the parameters contain?
What is the point of adding "?" in front of the parameter variable? Example: public void somar(int n1, Date data?){ } OR public void somar(int n1, Date? data){ }…
-
0
votes2
answers322
viewsRead and edit a specific word in a string (c#)
I have a text file: https://imgur.com/a/2DKpF I put this piece of code in a string, and I need to replace the name inside (in the case of Matthew) to another string name.…
-
0
votes0
answers49
viewsError when trying to insert data from a mixed table
I’m starting an MVC project and I’m having a problem that I can’t fix. [Table("InfoGeralEmpresa")] public class InfoGeralEmpresa { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage",…
-
0
votes1
answer268
viewsWeb Service NFE São Paulo City Hall Error 1402
good afternoon. I am creating a code for access to the NFE Web Service of the Municipality of São Paulo, calling the NF-e Issued Query Request method. I created all the integration code, including…
-
0
votes0
answers55
views -
0
votes1
answer3215
viewsHow to check if a checkbox in a form has been selected through another form?
I want to check if a checkbox has been selected in a form, because I am working with several forms. Using the following code, : frmPrincipal f = new frmPrincipal(); if (f.chkNotificacao.Checked ==…
-
0
votes2
answers151
viewsHow to map an Excel column to a Database column
I needed help to do the specific mapping of a column of an excel file to a column of a database. I can read the excel file but I just can’t map the file to the column I want in the database. If you…
-
0
votes2
answers408
viewsC# returns an HTML string
Good, I use the following code to convert a numeric value according to the user culture: value="@(Model.KnowAcquisition.Cost.HasValue ? Model.KnowAcquisition.Cost.Value.ToString("n2",…
-
0
votes0
answers158
viewsInstantiate Unit of Work with only 1 context. EF 6 Simple Injector
In a simple application, I have the code below that works up to a certain point, very well. However, for each Service that is instantiated to the Form, a new working unit is created, consequently a…
-
0
votes2
answers425
viewsClass association or inheritance?
What better way to create an association or heritage where I have the class User and the class Academic whereas Academic is a User User-class: public class Usuario { public int Id { get; set; }…
-
0
votes1
answer56
viewsError while Logging In
I created a View here to log into my system, but in part of ModelState.IsValid just call me back false, I don’t know why, someone could help? My code of View is as follows: [HttpPost]…
-
0
votes1
answer1011
viewshow to put a video inside a pdf
How to insert a video into a generated pdf using the iTextSharp library? I need the library because it also does file union and digital signature.
-
0
votes0
answers424
viewsHow to Fix Class Registration?
I am trying to call an external application to my application and when I call this application I get error following. Retrieving the COM class Factory for Component with CLSID…
-
0
votes1
answer45
viewsWrite a default value within a given cell in C#
I’m making a console application that reads data from a spreadsheet and compares it with values reported in the database. There is a default value, if a field of this worksheet is not filled in, I…
-
0
votes0
answers334
viewsSemantic Modal UI Submit Window and Form Validation
I have a modal window using the semantic UI framework, I can easily use Helper @Html.Beginform it validates 1 field, but not the others. I need to do this validation via jquery when I do Submit…
-
0
votes1
answer35
viewsRegistering attributes from different classes in the same View
I have a Teacher class that has a User, and I want to register the User fields in the Teacher View. How can I be doing this public class Usuario { public int Id { get; set; } public int Matricula {…
-
0
votes1
answer52
viewsShow Datareader return date in View?
I have a form where I have at View: <div class="col-md-2 form-group"> @Html.LabelFor(x => x.CLIENTEDESDE) @Html.TextBoxFor(x => x.CLIENTEDESDE, new { @class = "form-control", type =…
-
0
votes0
answers40
viewsAccess FK attribute in Entity Framewokr
I have the class Cliente who owns a IList<Produto> and the class of produto has a ClienteId (which is FK) and an attribute Cliente Cliente { get; set; }. How to access the attribute Nome of…
-
0
votes1
answer245
viewsHow to show an exception message if the user does not check a radio button on Xamarin Android?
I need to display an error message on the screen if the user does not check a radio button. In this code, there are 13 radio groups separated into 4 radio groups I tried to use Try/catch and…
-
0
votes1
answer1720
viewsStandard Windows Form Actions [Minimize - Maximize - Close]
I’m using the visual studio - Windows Forms, and by default the form has the control buttons of the "Minimize" another of "Maximize" and another to Close the form that is a "X", I need to manipulate…
-
0
votes1
answer137
viewsHow to print two images on two different pages at once?
Hello! I can print a panel (pnlPrint) using the following code. But, I am not able to print a datagridview that already belongs to the same form together, on the second page so that the two leave in…
-
0
votes1
answer167
viewsDoubt with Viewbag, loading information for editing
I’m with a mistake, when I go to make a record, I upload the information this way: //lista var tbuscarCategoria = new CadastroCategoriaAplicacao(); var listarCategoria =…
-
0
votes1
answer79
viewsConflict between similar objects in the Entity Framework
I have the following class: public class Conteudo { public long Id { get; set; } public string Categoria { get; set; } public string SubCategoria { get; set; } public string Descricao { get; set; }…
-
0
votes1
answer121
viewsHow can I turn the entire text content into c#
How can I get a file .txt and turn it into a chain of integers? My program has to take the matrix that is inside the file .txt and put inside a matrix in the program so I can manipulate the data…
c#asked 7 years, 1 month ago Kevin De Bortoli 67 -
0
votes0
answers47
viewsHow to kill this process of Printing of Mozilla?
I need a C# code that kills this print process, or at least the process name.…
-
0
votes0
answers127
viewsUnable to locate Control ID in Controlparameter - Asp.Net
Hello, I’m having a question getting the id of a book author and adding it to a book creation, and the book to be published should have an auto-incrementing Book ID, a book name and the author ID.…
-
0
votes1
answer38
viewsDoubt when obtaining the value of a radioGroup to send in an email
Hello, in my code I have 4 Radiogroups and I will pass their value in an email. So far so good, but in my code I am not able to (I don’t know how to do) send only the text of Radiogroup that was…
-
0
votes2
answers256
viewsShow "Loading..." while browsing between pages
When I make a call ajax I can already show/hide a loading gif like this: $(document).ajaxStart(function () { $('#loadingFull').fadeIn(); }).ajaxStop(function () { $('#loadingFull').fadeOut(); });…
-
0
votes1
answer748
viewsObject reference not defined for an object instance. C# (on installation)
By the error message, it was understood that there is an object not instantiated, in which I would be making reference. Error: However, this same application works perfectly on the development…
-
0
votes1
answer202
viewsError rendering Partialview in a View
I have a View and within it I want to render a Partialview. What happens is that the partial is of a model different but that has relationship between them. I want to show a partial as if it were…
-
0
votes2
answers202
viewsInteger reading via console
Good evening, folks. A basic question: In the code below class Conversora { double Oneknot = 1.852; // km/h public void Conversor(){ Console.WriteLine("Informe a velocidade em nós: " ); int speed =…
-
0
votes1
answer304
viewsReal-time database replication
We have a client who needs to perform several queries in the database in a short period of time, something approaching 40,000 requests in less than 2 hours. I created a program that bridges the gap…
-
0
votes1
answer199
viewsHiding AES decryption key in android app
How can I not only hide AES keys but also encrypt and decrypt using predefined keys/commands in a native library(Encounter.), so that I can compile and include it in my android app. That is, calling…
-
0
votes0
answers75
viewsWebbrowser can’t play my text in the text box
I have a system running on a client and now he asked me for a feature that I’m a few days cracking my head and I can’t do. He needs the application to post in his facebook groups at a certain time…
-
0
votes0
answers275
viewsinserting data into web api
I have a SPA application and it consumes a REST API made in ASP.NET Webapi. When trying to accomplish a Insert in the API, the following error is returned: Response for preflight has invalid HTTP…
-
0
votes1
answer48
viewsError doing a Return in windows form c#
Could someone give me a hand, please, I’d like to know what I’m doing wrong so this giving this error at the time of return. I want to show on Grid these fields: SubCategoriaId, SubCategoriaNome,…
-
0
votes0
answers181
viewsHow to see the open processes within Visual Studio?
Is it possible to know which processes are opened inside Visual Studio through some hotkey? I am debugging and the error message is that the file is opened in another process, I checked if it was…
c#asked 7 years ago Leonardo Lima 207