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
votes2
answers1053
viewsHow to fill a list C#
I need an appeal similar to the one made below: email ListaEmail = new email(); … while … { email Email = new email(); Email.email1 = adoDR["email"].ToString(); Email.tipo =…
-
0
votes1
answer1815
viewsStatic method has no access to class variable
Hello, I have the following problem: I have a static method that uses a class variable, but Unity gives me the following error: \Assets Scripts Gamecontrol.Cs(3,3): Error CS0120: An object reference…
-
0
votes1
answer73
viewsRepeating data from a JOBJECT
I managed to make my JArray return a list, in this list contains 03 Ids, but the way the system was done, they made a way to return only the first Array. Follows the code of what is returning to the…
-
0
votes1
answer100
viewsXamarin Mac Agent Limited
I’m trying to program for iOS using Xamarin, but I’m starting to get frustrated. When I open Xamarin Studio on MAC, I can normally view the design of my layout, but when I try to visualize using…
-
0
votes1
answer380
viewsConnectionstrings: Write to app.config or windows registry?
My question relates to what is the best way to maintain the ConnectionString of my system on disk to be read as needed, ie what is the best way to do this by writing it to the file app.config, or…
-
0
votes2
answers30
viewsParameters of the Abels in Printpage
What parameters are possible to define the printing of Abels: The code I’m using is as follows:: e.Graphics.DrawString(label_nota_entrega.Text, new Font("Arial", 14, FontStyle.Bold), Brushes.Black,…
-
0
votes1
answer75
viewsDatagriedview scrollbar track records - C#
I have a Datagriedview where I add my items. When it arrives at a certain number of records on the grid, it adds up and we can’t see the rest. Is there any way to make Scrolbar dynamic? For example,…
-
0
votes1
answer342
viewsJSON return with WEBAPI
I’m creating a WebApi where his return and the following. [{ "$id": "1", "Operadora": { "$id": "2", "Contato": [{ "$ref": "1" }, { "$id": "3", "Operadora": { "$ref": "2" }, "id": 5, "telefone":…
-
0
votes1
answer100
viewsSelect Row in **Datagridview** right click
From now on I thank you for your time :D I have a dataGridView filled by a Datatable I want to select (fullRowSelect) it only when right-clicking and not left-clicking. Someone helps?…
c#asked 5 years, 8 months ago Gustavo Pedro 201 -
0
votes0
answers44
viewshow to create a reportViewer using a dataset
hi would like to know how it creates data table from a select and save as PDF code used namespace WindowsFormsApp1.dbSetTableAdapters {…
c#asked 5 years, 8 months ago Felipe Carlos 1 -
0
votes1
answer82
viewsI can’t do include
I try to make include, but the message appears : In some of the research I’ve done they say to include using System.Linq; using System.Data.Entity; but mine already contains these. My classes are:…
-
0
votes1
answer33
viewsInsert only items in a Dropdownlist that have already been used in the main register?
I would like to insert in the DropDownList only the sectors that have already been used in contact registration. In my ContatosController in the ActionResult in the method Index I did this, but the…
-
0
votes1
answer161
viewsIs it possible to have more than one WEB-API under the same domain?
Good afternoon! I am new in the area of development and I am walking in the area of Web applications. I have developed a web-api that is already hosted and running. However, I am developing another…
-
0
votes1
answer444
viewsAutomapper Relationship one for many - Model to Viewmodel (and vice versa)
MVC scenario, where Controller talks to Application who talks to Domain. I’m trying to map one to many with Automapper. This is my Model: public class Estado { public Guid EstadoId { get; set; }…
-
0
votes0
answers45
viewsConnectionstrings Visual Studio Code
I’m using Visual Studio Code with the mssql extension on linux, I need to nail Connection Strings from a database I’ve already created, but I’m not getting.
-
0
votes0
answers147
viewsX-axis time of graphics C#
I have the following chart in my Windows Form: I set the X axis to display Time, as shown below: Below the methods I call to draw the graph: private void funcaoQualquer() { while (true) {…
-
0
votes0
answers371
viewsExport Data to Firebase
I would like to export data to my BD Firebase. I have a service set up in Visual Studio in C# which creates a list with name and price. I need to export this data to Firebase or export a txt file if…
-
0
votes0
answers141
viewsLog in to AD and create users c# Forms
Good afternoon, everyone! I’ve done a lot of research on this, but not on c# Forms, I tested some codes I got here and nothing. what I would like to do is: make a Forms where I inform the (IP, USER…
-
0
votes2
answers643
viewsDisable button during javascript processing c#
I have the following Asp button: <asp:Button ID="btnOk" runat="server" AutoPostBack="true" CausesValidation="true" ClientIDMode="Static" Text="Ok" Width="80px" OnClick="btnOk_Click"…
-
0
votes1
answer49
viewsDoubt with virtual properties
I have two tables: A and B On the table A have: Id Nome On the table B have: Id Nome IdA(FK) -> de A In the application would be that? public class A { public int Id { get; set; } public string…
-
0
votes1
answer70
viewsPrintout from Microsoft.Office.Interop.word.dll only performs 1-page document printing
Good morning guys. I’m using the lib Microsof.Office.Interop.Word.dll to carry out the printing of a word document. When the document has only one page, the printing works normally. The problem is…
-
0
votes0
answers84
viewsPlace the executable in the client without having to install Sqlserver
I developed an application in Visual Studio using C# Windows Forms and SQL Server 2017 database. I need to put in the client’s machine only the application executable and the extension file. mdf,…
c#asked 5 years, 8 months ago Bruno Queiroz 11 -
0
votes1
answer55
viewsImport codes for reuse in Asp.Net MVC
I made this image class 1, and I wanted to reuse, import the whole class to be in the marked place of image 2, so I didn’t have to change on all pages whenever I want to update something.…
-
0
votes2
answers161
viewsCustomized Viewbag, how to do?
I need a custom Viewbag, which brings the name of the teacher and the id, referring to the registered school, for this I did: ViewBag.ProfessorID = new SelectList(from u in…
-
0
votes2
answers925
viewsIs it possible to make a synchronous call to Webapi?
It is possible to make non-synchrone calls to WebApi? I don’t want my application to pass beaten by the method that executes the query to WebApi, I want her to expect a response and take an attitude…
-
0
votes2
answers187
viewsload date time without javascript
I wanted to know if it is possible to send directly from the controller, for example the current date and time of the system without using javascript. Ex: <div class="form-group">…
-
0
votes1
answer99
viewsList local windows users with Forms c#
Good users! I created an application to create windows users local in bulk, got help here from some users was ball show, but I’m in a little trouble now: i need to make a condition where I before…
-
0
votes1
answer35
viewsFill bank by expanding a given value on so many items
I have in the bank the registration of the building, with the number of rooms qtdSala, among others. I am trying to insert, in another grid, each room according to the value entered in the qtdSala,…
-
0
votes1
answer858
viewswindows service c# - error 1053
Create an application Windows service c#, I use a setup project to install the service in windows, when I try to start the service in windows the following error occurs: error 1053 the service Did…
-
0
votes1
answer62
viewsForm remains open after this.close()
I have a main menu form, which calls the student register. But the exit code of the student form does not close it, calls the main form but it remains open in the background and I can’t even close…
c#asked 5 years, 8 months ago Bruno Moraes 69 -
0
votes0
answers31
views -
0
votes2
answers132
viewsRestsharp connected with Firebase but shows no result
I did a job in C# and now I need to connect this service with my bank on Firebase. The following is the method in Library for connection with the Firebase: public static void restAPI() { var client…
-
0
votes0
answers47
viewsArgumentexception: The 'Clientid' option must be provided
I’m uploading my application to the aws servers. When I run the application locally it works perfectly, but when I test it in the cloud I get the following error. The parameter 'Clienteid' is my key…
-
0
votes1
answer32
viewsSave application shutdown mode
I have the following scenario: 1 application that runs on 10 machines, where when the application is running it is in on-line and when it’s not, that machine is like off-line, that communicates with…
c#asked 5 years, 8 months ago Gustavo Pedro 201 -
0
votes0
answers188
viewsHow to customize the HTTP return message/code of an expired/invalid token in Web Api 2 + Owin?
When my token expires and becomes invalid, I get a 404 (Not found) error return, but the truth is it should be a 401 (Unauthorized). The problem is I don’t know how to customize it. I’m using…
-
0
votes1
answer72
viewsMatrix program error in C
I am starting now in C programming and I have a problem in my C program. The problem is that the printout matrix appears all zeroed. #include <stdio.h> #include <stdlib.h> int main (){…
-
0
votes1
answer56
viewsHow to Open Another Form by Double Clicking on the Cell
I have a table called tournaments that shows the type of game, the name of the tournament and the date. I want you to do double click in the cell of the type of game open the teams of this type of…
-
0
votes1
answer32
viewsHow to use Dropdownlistfor
In an archive .cshtml need to put a Dropdownlistfor<>. It would be populated by a virtual property, which is a foreign key in this Model. It would be this on .cshtml: <div…
-
0
votes1
answer42
viewsEdittext.Selectionchanged event on Android
I need this event you have in Windows Forms: private void richTextBox_SelectionChanged(object sender, EventArgs e) { } Only for Xamarin, on Android. Note that I’m not using cross-Platform app. I can…
-
0
votes1
answer96
viewsWeb api 2 within MVC project. How to prevent redirection to login page when token is not valid
I’m doing a Rest API on an MVC project. On the API controllers (ApiController) place the Dataannotation Authorize, when the token entered is invalid, it detects and tries to redirect to the login…
-
0
votes1
answer155
viewsTreat Exception in Jquery Post
I have this function Javascript (Post Ajax) that when the post she’s passing theif (r != "") {. I needed to capture what was an exception and treat her out of the if. JavaScript function…
-
0
votes1
answer163
viewsSend object with android object list to SOAP web service in C#, using ksoap2
I send an object containing a list of objects, the web service recognizes the object but does not recognize the list. This is the source code: public RetornoDto GravarRecebimentoNf (NotaFiscal nf,…
-
0
votes2
answers1157
viewsexceeded the 'max_user_connections' Resource
I’m not sure what the reason for the error I’m having but it seems that it is something related to open connections in the bank, where error is occurring if the application tries to create more…
-
0
votes2
answers409
viewsPass List to Actionresult
Briefly: I have a screen with a table populated by the list below, where I select the line through checkbox, I need to pass this list to my actionResult. As I do not have a form on this screen I can…
-
0
votes2
answers180
viewsError while running program using "args"
I am trying to run a program passing some values as parameters on the command line but is returning the error below. C:\Users\joao.mello\Documents\C#> .\exercicio32.exe 5 1 0 4 9 32 4 Unhandled…
-
0
votes1
answer117
viewsList all AD groups in a checkedListBox
I would like to know how to list all AD groups with C# Forms, and list in a checkedListBox, in several searches I did, I only found how to list the groups of a specific user. Note: I put the data of…
c#asked 5 years, 7 months ago Anderson User777 63 -
0
votes2
answers212
viewsPermissions management using Active Directory
I am developing an ASP.NET C# application and at the moment I am at the login point which is almost finished. I’m using<authentication mode="Windows"></authentication> and a code that…
c# asp.net security-guard authentication active-directoryasked 7 years, 9 months ago Andre Brandao 109 -
0
votes1
answer124
viewsupdate of lines followed according to items selected in listview
we have a table 1, which has building and rooms, building A, sala01, room 02.... , we need to put people in these rooms. These people come from another table(2), which fills the listview. This Lvi…
-
0
votes0
answers63
viewsError reading text file with Filestream C#
I am making a program that reads a txt file from the user’s machine, all the other files are normally read only a specific file that when it is read appears the following error. the error is in the…
-
0
votes4
answers1392
viewsReturn True or False in jQuery’s Success
< script type = "text/javascript" > $(document).ready(function() { $('#btnEnviarDados').click(function() { var strFomr = $("form").serialize(); $.ajax({ url: $("form").submit(), type: "POST",…