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
answers177
viewsEF Core - How to map a field from a table that relates to two fields from another table
I have a Person class (Personal Camp) that relates to the Personal class Accounting (Fields: Personal Accounting, Bookkeeping, Personal and Personal). Rationale: In the Person table the natural and…
-
0
votes0
answers5
viewsSearch Salesforce object using Netcoreforce
When using the Postman i can make a POST call that looks for a specific object in Salesforce without using the query. Example:…
c#asked 3 years, 2 months ago Elder Barbosa Lima 11 -
0
votes0
answers74
viewsCount number of files c#
Good afternoon! I have a listview with several checkboxes. I want to count all the checkbox files that are selected. I made the following code, but it’s not working. if (listView.Items[j].CheckState…
c#asked 7 years, 5 months ago Ana Carvalho 1 -
0
votes0
answers10
viewsHow to convert a string attribute of a Model containing an XML (Danfe) to PDF (ASP.NET Core)?
I’m sorry if the question wasn’t specific enough, but I’m a beginner in ASP.NET Core. Long story short, I need to have an endpoint that returns a PDF file to the front end of the application, PDF…
-
0
votes0
answers12
viewsSend data from one form to another c#
Hello, I have a following question I have a Form with some Textbox and I have a button that calls another search form, In this search form I already have all the information that I need to put n…
c#asked 3 years, 2 months ago Cristiano Rogoy 27 -
0
votes0
answers9
views -
0
votes0
answers31
viewsId not accepting value Asp mvc 5
People I am trying to do a login logic but in a way without using the other technologies of Asp mvc 5 [HttpPost] [ValidateAntiForgeryToken] public ActionResult Cadastro(Fornecedor fornecedo, int? id…
-
0
votes1
answer149
viewsHow to Recover SQL Server Data Correctly?
I created a CRUD simple using the ASP.NET MVC and I can save my logs normally. If I look in the database, my date (Dating) was stored like this: 2017-06-01 00: 01: 23.750 But when I try edit the…
-
0
votes1
answer93
viewsASP.NET C# Dropdownlist doubt
I have a module that generates reports on excel, being one of these reports, the module called Occurrences. Where through DropDownList it informs me all the records of the table OcorrTipoEntr, that…
-
0
votes0
answers153
viewsException when accessing web service in Xamarin.Forms application
I’m creating an application with Xamarin with Visual Studio 2017. I did all the tests on the web service and it accesses the database and records everything perfectly in the browser version. I have…
-
0
votes1
answer164
viewsUpload image inside Peater C# Asp.net
Hello, I am new here and I am in need of a help. I already searched the net and the solutions I found do not work. I have an image gallery editing screen, made with a Repeater, in each image listed…
-
0
votes1
answer100
viewsHow to change and maintain the mapping of classes and properties using ADO.net
When using a database I have tables and columns with names like: - tb_usuario usu_id last name usu_data_nasc - tb_product pro_id pro_name pro_desc_resumida pro_desc_completa When using ADO.NET…
-
0
votes2
answers92
viewsValue conversion
I need the string "hql" that would be my select to convert to int so I can compare values in an if. using System; using System.Collections.Generic; using System.Linq; using System.Web; using…
c#asked 7 years, 5 months ago Guilherme Padovam 437 -
0
votes2
answers189
viewsBack up more than one database. c#
I’m making an application where I should do automatic backups and Restore between databases. But I want to solve this step by step. For now I would like to know how I would make a selection of…
c#asked 7 years, 5 months ago Matheus Arduino 27 -
0
votes1
answer358
viewsEdit Excel spreadsheet with C# in Microsoft Azure
I have a web application that reads an excel spreadsheet and imports the cell values into the database automatically. I am using COM, so it is necessary on the machine Microsoft Excel installed.…
-
0
votes3
answers764
viewsError In Modelstate Validation
I am wanting to return the validation errors of my model. Only I get an error message when I try to register. System.Linq.Enumerable+Whereenumerableiterator`1[System.Web.Mvc.Modelerrorcollection]…
-
0
votes2
answers51
viewsResolve error Value of 'X' is not Valid for 'Selectedindex', where X is any Index value
Hello. I asked a question days ago about capturing the value of a cell gridview in a Form secondary and send it to a combobox in the Form primary. I have received a satisfactory response which…
-
0
votes0
answers71
viewsStream without C#content
Good afternoon guys I have the following code: Stream retorno = new MemoryStream(); using (var stream = new System.IO.StreamWriter(System.IO.File.Open("c:\\Temp\\file2.xml", FileMode.OpenOrCreate,…
-
0
votes1
answer288
viewsReturn of Webapi Dynamic types
I am writing a method in Webapi that returns the type Httpresponsemessage. I have an appointment that returns a type Dynamic that would return the query of the data as it is different information.…
-
0
votes0
answers70
viewsRead start and end date of an event in the database
I made a report screen to read some values from a database. When I type for example 01/05/2017(start date) and 31/05/2017 (end date) the bank returns me as wanted. But when I enter the final date…
c#asked 7 years, 5 months ago Emanuel Rezende 1 -
0
votes1
answer283
viewsProblem with ASP.NET Checkbox "The Parameter Conversion from type 'System.String' to type 'System.Boolean' failed."
I’m having the following problem with a checkbox I have a checkbox list that is dynamically loaded (as the items that exist in the bank a checkbox is generated). I currently have only three items…
-
0
votes1
answer37
viewsCLR . NET - ERROR -> 9521 exceeds the maximum accepted message size of 4,000
My code makes a webapi post from a trigger in an SP that monitors my database. This POST works well for msgs of up to 4000 characters but above that the SP gives this error: "ERROR -> 9521…
-
0
votes1
answer70
viewsProblem using Bindingsource C#Canceledit()
I am creating a CRUD and I am using the Bindingsource component with Datasource Typed with my Parents class. In the form I placed a textbox linked to my bindingSource in the property Name of my…
-
0
votes1
answer316
viewsINSERT with database information inside another C#database
I am trying to make an application where I can back up several banks at the same time by placing the information of the banks (which will be backed up) inside a bank that will allocate this…
-
0
votes1
answer55
viewsRTF formatting.
I have an RTF in the database that saves colors, enter, among other actions that the user gave. I am using the following code to convert the RTF to show in HTML, however I am losing all these…
-
0
votes1
answer89
viewsError while paging using Pagedlist with List<Dinamyc>
I’m trying to make a pagination of a Webgrid using Pagedlist but there is conversion error: Additional information: Cannot convert type implicitly 'Pagedlist.Pagedlist' in…
-
0
votes0
answers109
viewsUse user input values in Asp.net c# webforms
I created a form for the user to update the registration data. The user’s "old" data is stored in session variables that fill out the form as soon as the user clicks to update registration. The…
-
0
votes0
answers207
viewsProblems when deserializing XML
I have the following code: public T LerXml<T>(string pArquivoXML) { byte[] xmlBytes = Encoding.UTF8.GetBytes(pArquivoXML); Stream xmlStream = new MemoryStream(xmlBytes); using (var stream =…
-
0
votes1
answer192
viewsReturn a new object using the Foreach function
Have the following list List<EmployeeTotal> totals = Context.Database.SqlQuery<EmployeeTotal>(query).ToList(); I want to transform all objects in the list totals on a new list of the…
-
0
votes1
answer172
viewsError creating a condition in Webgrid’s Html.Raw
I am trying to put a condition in a Webgrid line and the following error occurs: Cannot convert lambda expression to type 'string' because it is not delegate type Even based on this post Variable…
-
0
votes1
answer234
viewsError running SQL "Create Trigger..." inside a C#application
Goal: Run a create Trigger script using a string within C#. Problem1: Table not found (because the script does not indicate in which Table to create Trigger). Tentative2: Start string with "Create…
-
0
votes1
answer375
viewsClear Modal with Button Without Saving Data
I have a modal where I use it to include and change the data. I check if the field txtid is completed. If you have a change, it is not included. To fill in the fields the user needs to select the…
-
0
votes1
answer99
viewsissue of multiple choices in APS MVC 5
I’m developing a project where he’ll have multiple choices. My problem is that I am not able to show only the questions I want, for example when clicking on the questions would appear to the user…
-
0
votes2
answers600
viewsRecover image in SQL SERVER and put in a REPEATER list
Today I recover information from a database and I list in a REPEATER, until then all blz. But I also need to take an image from the database and show on this REPEATER. Follow below as I show the…
-
0
votes1
answer680
viewsHow to get the Hidden input value inside the controller using Formcollection?
I’m trying to get the value of a Hidden input inside the Controller by Formcollection, but the value is reset. To increase the value, I’m using a Javascript function. HTML: <form…
-
0
votes0
answers96
viewsWindowsform - How to add two Datagridviewbuttoncell in the same Ell?
Is it possible to add two Datagridviewbuttoncell type buttons in the same cell in a Datagridview? I’ve done a lot of research and so far I haven’t been able to find any solution. Edit 1: For…
-
0
votes1
answer240
views500 (Internal Server Error) when defining action as [Childactiononly]
I want to block partialview url through url using [ChildActionOnly]. Face problem, follow code: HTML: <li style="cursor:pointer"><a id="button_id">Criar</a></li> JS:…
-
0
votes0
answers371
viewsThread in Webbrowser c#
I need to use a thread that can work together with a webbrowser in c#. She just needs to execute the command, but as it is a visual component I’m not getting. Below I detail some attempts and…
-
0
votes0
answers129
viewsLoading of Memorystream C#
How do I load a document over 4069 kb. Example: I have a 14,000 kb document to click on MemoryStream that does not load because it is giving a memory exception! How can I load this file? Excerpt…
c#asked 7 years, 5 months ago Laércio Schluter 1 -
0
votes1
answer62
viewsHow to correctly apply String.Format
I have the following event: protected void Page_Load(object sender, EventArgs e) { this.tituloTela.InnerText =…
c#asked 7 years, 5 months ago Igor Carreiro 1,917 -
0
votes0
answers43
viewsHow to get application settings in static classes in Aspnet Core 1.1
In my application’s web project I have the appsettings.json: { "Foo": "Exemplo" }, And I have a class that reflects that configuration: public class FooSettings { public string Foo { get; set; } }…
-
0
votes1
answer2499
viewsGenerate Credit Card Token
I am using the Pagseguro API Git and I’m unable to find how to generate the credit card token to make the checkout transparent. In the example project you have the following command: // Sets a…
-
0
votes1
answer392
viewsClass mapping with Fluentapi and Entityframework C#
Table Parents, State, City; A country can have several states and a state can have only one country; State->Parents : 1:N A city can have only one state and one state can have several cities.…
-
0
votes1
answer42
viewsProblem leaving form as top c#
I have 2 Forms. The main contains a button that opens the second form inside the main. private void btnCalculadora_Click(object sender, EventArgs e) { Calculadora = new frmCalculadora();…
-
0
votes0
answers27
viewsWindwosforms between windows 10 workspaces
I have an application in Windows Forms and several work areas and I need to open a window in all these areas, I already searched the internet and found…
-
0
votes1
answer36
viewsMigrations Entityframework C#
Error while performing Migrations. The ADO.NET Provider with invariant name 'Sqlclient' is either not Registered in the machine or application config file, or could not be Loaded. See the Inner…
-
0
votes2
answers456
viewsChange the name of the pdf file to hash and then manage to undo the name to read again
I’m doing a feature on a system where; Any sector will upload an important file, this file contains sensitive information linked to each employee of the company. Each employee can open his own file,…
-
0
votes1
answer93
viewsSort by Reflection with Getproperty
I have a generic class with a method that needs to sort a generic object. However, give error saying that does not recognize the Reflection Getproperty method, because lambda can not translate. How…
c# asp.net-mvc entity-framework classification reflectionasked 7 years, 5 months ago LeoFelipe 1,455 -
0
votes4
answers362
viewsHow do I skip the "Finally" block, in C#, when the exception is generated?
If the exception is generated, I want to know if there is a way to "skip" the execution of the block finally. If there is no exception, the finally perform normally. With the goto didn’t work. Code:…
-
0
votes0
answers69
viewsCalculate Values in Gaps in Form
Good afternoon! I’m having doubts about implementing an algorithm that can calculate the heat flow based on the formulas: q=ΔT/Rt ΔT=Temperatureinitial-Temperaturefinal Rt(Thermal…