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
-
1
votes1
answer148
viewsHow to flirt a checkbox via webbrowser?
I’m trying to book a checkbox via webbrowser, but I’m not getting through. HtmlElementCollection theElementCollection = default(HtmlElementCollection); theElementCollection =…
-
1
votes2
answers1000
viewsHow to get a list of values common to two lists with LINQ?
I have two List, the first, which is a list containing all the establishments available in the company, for example: Estabelecimento Sigla - XPTO Descricao - XPTO List Estabelecimento Sigla - RPTO…
-
1
votes1
answer83
viewsInsert data into db sql server
I’m having problems connecting my project to the database, I do not understand the reason, I’ve looked at several tutorials, use sql server 2017, I can access db in an application, but the site is…
-
1
votes1
answer364
viewsHow to get value from a json?
I use WebClient and DownloadString to recover json: using (WebClient wc = new WebClient()) { var teste =…
c#asked 7 years, 1 month ago Matheus Miranda 5,375 -
1
votes1
answer105
viewsHow to show a message after a send action?
I’m trying to make the Android app show an "email sent successfully" message after an email, which is linked to the action of the send button, be sent correctly. I tried to show a Toast, but it…
-
1
votes1
answer38
viewslambda error with Join when placing a Groupby
In this lambda, is giving error in select in t1 and t2. If placed Key says it does not recognize Totalliquido and the fields in t2. If removed Groupby works. public List<LiberacaoItensDTO>…
-
1
votes1
answer797
viewsPassing parameters to an executable
I have an application that is divided into two different executables. The first executable is the brain of my application, in this executable, in which I named it STUB, will be all the main logic of…
c#asked 7 years, 1 month ago Wesley Nascimento 395 -
1
votes1
answer193
viewsChanging text from another form does not work
Follows code: Form2: public void ChangeLabel(string s) { labelX1.Text = s; } And in Form1: private void button_MostrarSegundaTela_Click(object sender, EventArgs e) { if (Screen.AllScreens.Length…
-
1
votes3
answers3345
viewsGo through jquery inputs and check if you have a certain class in input
I’m picking up the inputs with the code var itensTabelaPresentation = ('#tabelaPresentarion > li'); and would like to walk through them and go checking if they have certain class, how do I…
-
1
votes1
answer89
viewsPizza chart is not being "sliced" using Sfchart
I made this Chart using Syncfusion Chart, private async void CriaChart() { SfChart chart = new SfChart(); DataService dataService = new DataService(); try { PieSeries pieSeries = new PieSeries() {…
-
1
votes2
answers1092
viewsHow to use Insert with multiple C# SQL records
I’m new here and also in the world of programming, today I managed to connect C# to SQL, by making a simple connection with the BD I can insert records, but when trying to insert 2 data in the same…
-
1
votes1
answer102
viewsExecutereader how to fill in the fields by searching
I’m having a problem understanding how to return the values within windows form (fill the textbox, etc). This method executes the Reader data but I don’t know how I can use it to fill in the fields.…
-
1
votes1
answer222
viewsProblem with Stack Algorithm
I started programming in C# recently and I’m already having some problems... I took a URI exercise to train and I have a "mistake" that I don’t know how to solve. Anyway, here’s the situation: The…
-
1
votes1
answer334
viewsDifficulties with Dll import C#
I’m having a hard time rewriting a method of a dll in C#, we bought a price checker from a manufacturer, in case it provides a dll and an example code in Delphi. This dll has some functions between…
-
1
votes1
answer67
viewsPlace the value of an hql on a var
I need to get my two tables to work together, where the Abastecimento take the Product Name(NomeProdutoId), table Compra, I managed to get him to take the Product Name, but I wanted him to bring me…
-
1
votes2
answers243
viewsGrouping query by date
I am developing a query with C#, but I have a problem to accomplish it. I need to group by date. Code: public void BuscarVendaDeProdurtos_Saidas() { var data1 =…
c#asked 7 years, 1 month ago ubirailton Britto 11 -
1
votes2
answers50
viewsHow to send 1 object and 1 vector to a C# API with $http.post?
In my application I created a C#API, which is consumed by my web application in Angular. I need to pass 1 object and 1 vector as parameters to the API, but the content arrives empty in the API, how…
-
1
votes1
answer276
viewsDatagridview - Edit by Currentrow.Index does not leave Index 1
Note: I’m learning to use Datagrid, so I’m testing some examples. I have this form: And this code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;…
-
1
votes0
answers32
viewsHow could I create a class that would serve both the sandbox API and the production API?
I am integrating the CIELO API into my system, they have two types of API, the sandbox and production. Each with his own merchantKey , merchantID , apiUrl and apiUrlQuery I have 4 constants for each…
c#asked 7 years, 1 month ago Leonardo Bonetti 5,313 -
1
votes2
answers655
viewsValidation of fields from Razor forms
I’m using MVC5 Razor to create my forms, now I have a question for field validations of that form; Example: @Html.LabelFor(m => m.Nome, "Nome:") @Html.DropDownListFor(m => m.Nome, "Nenhum" ,…
-
1
votes1
answer83
viewsHow to format data extracted from datagridview to excel
private void button1_Click_1(object sender, EventArgs e) { Microsoft.Office.Interop.Excel._Application app = new Microsoft.Office.Interop.Excel.Application();…
-
1
votes1
answer368
viewsLoad two fields from a Datagrid using a txt file
How can I do this, see what I have so far: Datagrid, I need to load the comboBox and the valor unitário with values I previously saved on a txt Button save products, save name - price private void…
-
1
votes1
answer928
viewsASP . NET MVC - Windows Authentication - Browser Authentication Form
I am developing an ASP . NET MVC application whose access permissions will be managed from parameters set for users on Active Directory (AD). To search for this data from AD I developed methods that…
-
1
votes0
answers94
viewsError connecting to DBC bank
I am trying to connect my program to a DBC database using the tutorial from this link: http://rodrigolameira.blogspot.com.br/2009/08/conectando-banco-dbc-em-c.html The code used is as follows::…
-
1
votes2
answers96
views -
1
votes0
answers32
viewsDepencyresolver problem when using Testserver, difference between instantiating Httpconfiguration and not instantiating
I have a simple authorization filter that to get an instance of a service I require in GlobalConfiguration.Configuration.DependencyResolver. Thus: var service = GlobalConfiguration.Configuration…
-
1
votes0
answers31
viewsWhenever I turn the debug mode, it gives me An hundled Exception error occurred
That is the code public override void OnCreate() { try { base.OnCreate(); //If debug you should reset the token each time. #if DEBUG FirebasePushNotificationManager.Initialize(this, true); #else…
-
1
votes0
answers147
viewsHow to compile C# code at runtime in an ASP.NET MVC5 project?
I tried to use the CodeDom, but when trying to find a DLL specific to execute my code the command Assembly.GetEntryAssembly().Location always returns to me null. It seems the projects ASP.NET are…
-
1
votes0
answers18
viewsI can’t receive messages for my App in release mode
In debug, I took the token and added it in my Nder and sent PN. I deleted it, recompiled it in release mode and now I can’t send PN(Push Notification). See the code of my Sender: public partial…
-
1
votes1
answer245
viewsExchange variables from selected word documents
I saw many examples of exchanging variables in word document with find replace, but only with a document, being passed the path of it in an 'Object template(allows only one informed document)'. In…
-
1
votes2
answers138
viewsTolist() returning read-only
Follows code: using (var db = new Entities()) { var result = db .Tabela1 .Select(x => new { x.Coluna1, x.Coluna2 }) .ToList(); foreach (var item in result) { if (item.Coluna1 == string.Empty) {…
-
1
votes0
answers157
viewsThe name `buildTargets' does not exist in the Current context
EditorWindowIntegration.cs(30,4): error CS0103: The namebuildTargets' does not exist in the Current context` public class EbsEditorWindowIntegration : EditorWindow { #region Private Fields private…
c#asked 7 years ago Unknown Unknown 11 -
1
votes2
answers61
viewsStatic class system settings in the Entity Framework
I am trying to create settings for a system. I thought of a class similar to the example: Class: public static class Configuracoes { [DisplayName("Casas Decimais")] [Description("Informa o número de…
-
1
votes2
answers2277
viewsPass jquery parameters to Url.Action ASP.NET MVC
I’m having trouble assembling a URL with parameters. Until then I managed using the @Url.Action, but the second parameter dataPesquisa is going nil. I imagine when the parameter passed directly to…
-
1
votes1
answer109
viewstextbox value for another textbo using Tabcontrol and Tabpages
I’m using in a form one TabControl, three-page. In the TabPage1 have a TextBox (seller), I need to take the value of this Textbox to another TextBox who is in the TabPage3. How can I do this between…
-
1
votes1
answer87
viewsCatch Startaddress with the Thread Module name of an external program
I’m trying to differentiate the threads of a particular program. with "Processexplorer" software I can easily get through Start Address, since the method name appears: I tried to catch Startaddress…
-
1
votes1
answer32
viewsGoogleapi in Visualstudio
I’m trying to implement on top of a ready-made class that I was sent that uses Googleapi, but I can’t possibly add the reference to the project via Nuget. Do you know where I can download it? Follow…
-
1
votes0
answers79
viewsI get messages in the background but don’t show the badge with the message counter
In my App I can receive messages in Background. In foreground I can see the badge and qde of incoming messages. I just can’t in the background. I use the plugin Xamarin.Firebasepushnotification of…
-
1
votes3
answers1181
viewsHow to access the elements of a list declared in a different class?
I have developed a code that generates a list when the following input data is informed: List size (or how many "Indexes") The values that will fill the said "Indexes". Values are collected within a…
-
1
votes0
answers48
viewsPopup does not appear in my App
Use Rg.Popup.Plugins for popup creation. Well, when I put in project it doesn’t run, the screen darkens, but I click on it and nothing happens. I put a button with a red background and it still…
-
1
votes0
answers28
viewsI can’t resize Popup in my App
I downloaded a project and I have a popup working. I went to do the same thing in my project and nothing. There is no error, only the popup does not go up as it should, it occupies the entire area…
-
1
votes0
answers280
viewsDoubts regarding loading combobox in c# with Mysql database
good afternoon, I would like to know how I can fill a combo box C# with data from a table in Mysql. I am making an application for a jewelry store, and I would like to know how I can fill the…
-
1
votes1
answer68
viewsRetrieve data from an XML file using Xpath and C#
I have the following document XML, and I intend to do a search/filter by name Givenname using Xpath. How to do? XML <bloodonors> <donor> <Number>1</Number>…
-
1
votes1
answer51
viewsSyntax error in final key
In my code are appearing the following errors: Error 1 } expected** Error 2 Type or namespace Definition, or end-of-file expected** using System; using System.Collections.Generic; using System.Linq;…
-
1
votes1
answer191
viewsRun method of one nested class as property in another in C#
I have the following class: public class Feliz : IFeliz { //public algumas propeiedades e tals... { get; set; } public bool EstaFeliz() { //Faz alguma coisa... } } And she’s a property in another…
-
1
votes1
answer27
viewsEvent validating is not working
I have this form: As the person puts the date of birth and clicks on identify category is made two checks: If the name has been filled in; If the date of birth is greater than the current date; But…
-
1
votes2
answers662
viewsHow to transform a json object array into a list of objects in c# using Json.NET
I’m starting to learn c# and I’m picking up to do this task, take an array of objects from a json and turn the elements of that array into objects of a specific type and put them in a list. Create a…
-
1
votes2
answers65
viewsReplace in undefined texts
I have a question regarding replace, I am populating values in word but some values I will not have available but if not fill in the word will be shown @@Variablename, so I was wondering if you have…
-
1
votes1
answer58
viewsDaily folder creation in C#
I have two programs distinct from each other here, one of them creates folders named with the current date whenever I run it, then I made a Schedule for it and daily it runs alone, and the other is…
c#asked 7 years ago Felipe Deolindo 179 -
1
votes1
answer282
viewsEF6 MVC5 C# - How to maintain filters with Querystring page
Good afternoon, I have several pages where the user can filter through 5 different fields and when the user clicks on the form search button, which is configured with the GET method, the search is…