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
answer1710
viewsGROUP BY and SUM at Crystal Report
I need to do something relatively simple with Crystal Report but I’m not getting it. I have a report like this: OP | CLIENTE | PREÇO 1 João 10 1 João 20 1 João 30 2 Marcelo 15 3 Rodrigo 35 3 Rodrigo…
-
1
votes1
answer84
viewsPass variable through Converterparameter
I have the following code snippet: Visibility = "{Binding TipoDestinatario, Converter={StaticResource conversorTipoDestinatario}, ConverterParameter=}. You would need to pass a boolean variable…
-
1
votes1
answer142
viewsMultithreading Doubt in C#
I have the following scenario: Three types of threads can be created in the program, imagine they are, A, B and C. I have to respect the following rule: A thread C not can access the critical region…
-
1
votes1
answer1937
viewsHow to remove mask from a Maskedtextbox
I’m using Visual Studio to make an application using Windows Forms in C# and I need to get all the Maskedtextbox of the form, without masks. I’m using the code below right now. The Maskedtexbox are…
-
1
votes1
answer80
viewsIs it possible to integrate a windows Builder into Xamarin for Mac?
I’m currently using a Mac, but would like to continue using C# and create new GUIs, since I didn’t create much. So I looked for a solution to use C# for the Mac, and found the Mono framework, which…
-
1
votes3
answers8406
viewsORA-01036: illegal variable name/number
I’m having a little problem in my application. The routine of INSERT causes me to make a mistake: ORA-01036: illegal variable name/number Remembering that the database is Oracle and the application…
-
1
votes1
answer1271
viewsClose only one Window
I created a window JanelaUm, every time I click on button this window is displayed. in the code-behind of JanelaUm have the event window_KeyDown with the following code: if (e.Key == Key.Escape)…
-
1
votes2
answers406
viewsWindows form c# identify which Bindingnavigator button was clicked
How to identify which option (Add new, Delete and etc) was chosen in a BindingNavigator and which method to use to capture the click.
-
1
votes1
answer666
viewsJavascript error with Webbrowser
I am creating an application with Webbrowser component in C# but when running the following code it returns me Javascript error and does not run my other application that was developed in Adobe…
-
1
votes1
answer1524
viewsHow to install SQL Server together with the C# application created?
I have a C# project and I need that when I create your installer I also install SQL Server 2008 on the client’s machine. It would be possible to do this?
-
1
votes1
answer598
viewsHow do I navigate between pages on windows phone 8.1 using mvvmcross?
I’m browsing between pages on Windows Phone 8.1 using the following call: ShowViewModel<DetalheViewModel>(); When I click the button come back the app closes. How do I implement the back…
-
1
votes1
answer96
viewsValidating response in controller is giving error
Need to validate the answer in my method in the controller. For this I need an if. Why does the method not consider the return within an IF? Thus: public JsonResult ValidaLogin(string _email, string…
-
1
votes1
answer154
viewsCreate partial (partial) method in C#
You can create a method similar to a class that is partial? For example: Has the method $InitializeComponent() which is of the class of a form. I want to increment this function without touching the…
-
1
votes1
answer128
viewsXML query does not return values
The goal was to return the xml values but it is not returning anything: using System; using System.Xml.Linq; using System.IO; using System.Linq; using System.Collections.Generic; using…
-
1
votes1
answer204
viewsRecovering Multiselectlist MVC values
I’m not sure how to handle the received data via MultiSelectList. Also, I can only select more than one option on View if I press CTRL. There is a way the user can click more than one value without…
-
1
votes1
answer1041
viewsHow to create a Lambda expression with Group by and Order By
I’m having trouble creating a Lambda sentence with Group by and Order By Together. How to group by column Scope and Idescope, and sort by Idescope. Segue Sentença. public static List<Escopos>…
-
1
votes2
answers1997
viewsC# Simple - Forms - Pass to the datagrid what I select in the combobox
Guys, good afternoon, I’m new to programming language, I need a little help. I’m able to call the database data in the combobox with select, but I’m not able to do a function that when I click OK,…
-
1
votes1
answer2976
viewsInsert data into the database via a C#Ridview dataset
I have a form in C#: On this form there is a textbox where I enter the day of the week and a datagrid where I type in the hours. I put a column call time, with DataGridViewCellStyle { Format=t }…
-
1
votes1
answer287
viewsHow to retrieve the click on an array of buttons
I’m making a minefield, so I have to add an array of buttons to a panel (to be the houses). I created the button array and added each[x][y] button in a panel. But I don’t know how to retrieve the…
-
1
votes4
answers362
viewsC# e.Hasmorepage is in Eternal Loop
I am creating a system for printing labels as follows the code: private void printDocument1_PrintPage(object sender, PrintPageEventArgs e) { Image newImage; Point ulCorner; int x = 0; int xn = 0;…
-
1
votes1
answer1537
viewsHow to open a file that is within the solution with Process.Start
I added my solution in C# a folder called "files" inside this folder will be placed some standard documents that can be analyzed when registering some projects. I have a combobox in the form for the…
-
1
votes0
answers211
viewsC# service installer with custom actions
I’m doing a service in C#, and I want to create an installer. I followed some tutorials, and found the setup of Visual Studio kind of basic. Any suggestions on how to make a beautiful installer with…
-
1
votes1
answer728
viewsExpect response from a method to proceed
I have the following problem, I am doing a popup to display on the screen information, almost in the same way as a ShowDialog(), being so: GeneralPopUp popupErro = new GeneralPopUp("Titulo",…
-
1
votes1
answer1467
viewsApplication with Crystal Reports does not find database in client
I made a small application that uses Crystal Reports to generate reports. I did the . EXE of it with Instalshield LE, installed it on my PC and spun beauty. However, when installed on another…
-
1
votes2
answers223
viewsCurrency fields 1.99 saving as 199 on Access
I have a problem when I go to save the data of fields currency or decimal in an Access database using Visual Studio components. When I save something like 1.99m or has 1,99 in the textbox the data…
-
1
votes2
answers908
viewsPass connection string to dataset via code
How to pass the string connecting to the dataset via code? because the application I am developing cannot contain the app.config.
-
1
votes1
answer227
viewsBest score with playerprefs Unity-android
Hello. I made a normal best score system in Unity (when score>playerprefs, will set the text of textmesh). On the computer worked, only when I pass to Android the bestscore is 0 Someone would…
-
1
votes1
answer107
viewsError Login Asp.net MVC
I’m not able to validate my login, follow code below: public ActionResult Login(FormCollection collection) { AlunoAplicacao bdAluno; bdAluno = AlunoAplicacaoConstrutor.AlunoAplicacaoEF(); var Aluno…
-
1
votes1
answer1321
viewsEdit object list with POST form in MVC C#
I have the two classes below. I know how to make a screen to enter the data, and take the data from PERSON and PHONE, by model and for List. But how to do this on an edit screen? I want to show the…
-
1
votes2
answers586
viewsDifferent databases for the same Asp.net C#
In a club management system each club has its own database. There is a class DAL where it is responsible for obtaining the web.config to string of application connection. How to ensure that at login…
-
1
votes1
answer338
viewsShortcut on clickonce User Startup
I have an app ClickOnce, I have the option to create a shortcut on Desktop, but there is a way to make it add a shortcut in Initialize Windows? Programmatically, the user when installing the…
-
1
votes1
answer329
viewsDLL to encrypt a string
How to create a DLL in C# with Interop to traffic data between applications using encryption/decryption of a string that will be sent and received?
-
1
votes1
answer1005
viewsError saving list of MVC C#objects
As the post Edit object list with POST form in MVC C# I was able to make my application display the values. However, trying to save the data gives the error: The operation failed: The relationship…
-
1
votes1
answer118
viewsError ORA-12571 encountedred in Windows Service
I have a C# system running as a windows service, with Windows Server 2012R2. Eventually when the service tries to communicate with the database (to perform a query or make an Insert, for example)…
-
1
votes1
answer110
viewsAssociating List<T> with Webclient
How to associate a class List to a Webclient, and at its end calls another Webclient in a index different List< WebClient > clients; void BaixarTudo(List< string > urls){ for(int i=0;i…
-
1
votes0
answers267
viewsAutomatically log into the application using Windows Authentication
I need to automatically log in my ASP.NET application using Windows credentials (Active Directory), exactly the same as the Sharepoint ago. In Visual Studio already has a template (Framework 4.5)…
-
1
votes1
answer601
viewsDisable checkbox checked in listview
I added in my ListView the checkbox his pattern "Listview Checkboxes", when he is checked I need to disable the same so that it can no longer be "check", I tried to make the checkbox be as Enable…
-
1
votes1
answer629
viewsDifficulty positioning table on screen with bootstrap - layout only
I need to make a layout on my page, as follows. That I have three textbox controls, one at the bottom of the other and picking the other side all the rest with a table. See below how I need. I tried…
-
1
votes2
answers125
viewsLonglistselector on Windows Phone 8
I would like to make a screen with a LongListSelector this way, taking results of a webservice of mine and riding in this style. How could I develop this? I am layman in this part of XAML, it is…
-
1
votes1
answer138
viewsIdentify WCF Service client (intranet or internet)
I wonder if it is possible to identify the call if a WCF Service on the server, if it was called by a client inside the network (intranet) or outside the network (internet). I am implementing a data…
-
1
votes1
answer80
viewsApply style to first line after n
I have a textarea that had received a text. The style application will be minimal, so I didn’t want to use some editor like Ckeditor, for example. I believe the easiest way to work is to apply a…
-
1
votes1
answer2030
viewsError adding Httppost to controller
I’m having a problem adding the attribute [HttpPost] on my controller. I mean, I can add the attribute without problems, but when I compile and go to the registration form I just can’t access. I get…
-
1
votes2
answers2812
viewsDecimal variable removing decimal places
I have a variable in decimal which receives a value of a textbox, but when this variable receives the value with decimal places it removes the decimal place and stores the value without the same.…
-
1
votes1
answer806
viewsProcess does not close in task manager
I have the following code snippet to close my winform application: private void frmAgent_FormClosing(object sender, FormClosingEventArgs e){ if (MessageBox.Show("Deseja realmente fechar o sistema?",…
-
1
votes1
answer1355
viewsSystem.Argumentexception when using Mysql with Entity framework
I installed Mysql Connect in the environment, installed Mysql references through Nuget package. When I start the system and try to make an entry in the database, the following error appears: The…
-
1
votes1
answer403
viewsTwo types of search in the same textbox
I wonder if it is possible to search two types of variables (one at a time) in a single textbox. Example: public ActionResult Index(string pesquisa) { var usuario = from u in db.usuario select u; if…
-
1
votes1
answer1277
viewsHow to place image and text in the same Datagridview cell
How to place image and text in the same cell of Datagridview C#? I need both to be displayed in the same cell.
-
1
votes1
answer412
viewsCreate a method to get records by id
In my CRUD I want to create a method obterPorId(Cliente cli) I want to get the records by code, or by name, or other field. How would you look with Datareader? a correct way, using a method that…
-
1
votes1
answer1101
viewsUnknown supplier
I finished an application on the C# Windows Forms platform and want to publish it on a website, but the application needs admin permission to connect to the server and download to a Windows folder.…
-
1
votes2
answers766
viewsRemove objects from memory
I have a DataGridView in my project and a timer with refresh 5 seconds. I realized that the system was overloading the memory, as each time I listed the previous data remained in memory. This is the…