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
-
-3
votes1
answer45
viewsSending data to another table
Hello, I need some help I need to get data using Where to pass to another table : http://image.prntscr.com/image/712077abe80f4033a016675279a7a0dd.png (table of accounts ) In print, shows the "…
-
-3
votes1
answer46
viewsStatus of sale in C#
Good afternoon guys, all right? I am creating a car rental system in C# and would like to implement a function that returns me all cars and a column that shows whether the requested car is leased or…
c#asked 6 years, 6 months ago Michelangelo R. Anjos 1 -
-3
votes1
answer63
viewsWhat’s the foreach up to?
private List<Evento> ListaDeEventos = new List<Evento>();//cria a lista public void AddEvento(Evento e)//adiciona na lista { this.ListaDeEventos.Add(e); …
-
-3
votes1
answer125
viewsIt is possible to make Dropdownlist "readonly" equal to Textfield
I understand that the DropDownList already is readonly, since I can not change the values of the options, however I need to maintain the uniform behavior of the screen. In query mode I can assign a…
-
-3
votes2
answers252
viewsPower with For or While
I need a little help, how do I calculate the power using the for or while, I don’t want to use the Math.Pow function()
-
-3
votes1
answer2937
viewsHow to Compare Dates
I have this code to save the data entered, Dia, Diainicio and Diafim. protected void btnSavePontuacao_Click(object sender, EventArgs e) { decimal id_TipoDia = 0; string Dia = txtDay.Text; string…
c#asked 7 years, 9 months ago Ricardo Gonçalves 83 -
-3
votes2
answers64
viewsVARIABLE C# HELP
Good afternoon, someone can help me in a code? using System; using System.Collections.Generic; namespace Launcher.WesT { class Globals { private Config Configs_ = null; public string URLL() {…
c#asked 5 years, 6 months ago Rodrigo Pretti Fantin 59 -
-3
votes1
answer197
viewsExtensibility V10 Event Error After Blackout When Opening Customform
With the last update of PRIMAVERA this Demo code that was working previously, in the event open company, stopped working. using (var result =…
-
-3
votes1
answer83
viewsHow to use Priengine.Engine.Comercial.Clientes.Daproximonumerocbl()
In the creation of Customers via Interop.GcpBE900.GcpBECliente PrCli = new Interop.GcpBE900.GcpBECliente(); ....... PriEngine.Engine.Comercial.Clientes.Actualiza(PrCli); where the :…
-
-3
votes1
answer47
viewsminimizar Notepad.exe external program
I would like to have a Button when clicking on it in my form the Notepad.exe minimize to windows bar.as I do this code I have no idea ? private void button10_Click(object sender, EventArgs e){…
-
-3
votes1
answer782
viewsRead and insert data into a table via C#
I have this code to insert values in a table column: conn.Open(); comm.CommandText = @"INSERT INTO ArticleBarCode(Code, Code_Article, BarCode, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn,…
-
-3
votes1
answer48
viewsHow to mount a regex for certain strings c#?
How could I mount a regex for a random string. For example if I were to take every word that was in this format in a string, 02ef6308-72da-491a-86b3-884a9e6bd959 I did so, but it did not work to get…
-
-3
votes2
answers53
viewsReturn void in an Actionresult method?
I have this method below, and I need to have a condition that depending on it will open a new tab with a url: public ActionResult Index() { //condição return Response.Write(@"<script…
-
-3
votes1
answer71
views -
-3
votes1
answer42
viewsHow to transfer a javascript variable to c# aspnet
I have a Java from an aspnet project I would like to know how to transfer the id of this variable to the code c# for (var i = 0; i < data.operadores.length; i++) { options += "<option value=…
-
-3
votes1
answer31
viewsHow to always take the next 2 elements of a string
I have the following string: gxAjaxKey = "FF00FFFFFFFF2426FFFFFF046448FF70" I must take 2 elements at a time from this string and convert to byte: FF = 255 00 = 0 FF = 255 . . . 70 = 112 I wrote the…
-
-3
votes0
answers12
viewsGraphical interface c#
I want to create a game in c# without game Engines, for study really. I would like to do the graphical interface without any engine, as I said. Thank you
-
-3
votes1
answer532
viewsHow to check if an item has already been entered in a list in c#
There is the list classes Inside that list I put objects like gang Each object has (string)nameTurma.Text & a numerical value (int)numericUpDown1.Value I use the method addTurma to place objects…
c#asked 7 years, 4 months ago Amadeu Antunes 3,331 -
-3
votes3
answers898
viewsValidation and counting of days of a date
Consider an informed date in a form. Construct a function that checks if the date is correct (considering leap year, April 31, etc.). You need to pass the date entered in the form as a parameter. If…
-
-3
votes1
answer666
viewsConvert TXT to XML using C#
I want to put the data below that are in a text file (txt) for XML, what is the code C# doing? # Number | Gender | GivenName | Surname | StreetAddress | City | StateFull | ZipCode | EmailAddress |…
-
-3
votes1
answer56
viewsI can’t save my record
Buneas personal, I don’t know how to handle C#, so I’m doing the program following tips on youtube and other tutorials that I find, but I came across a mistake that I haven’t found how to solve...…
-
-3
votes1
answer104
viewsBuilder without parameters is not working, is leaving the object as null
I have a class with two constructors. The empty constructor (no arguments) is not working. Script shows no error. One of the constructors receives the parameters nome and limitedecredito; and…
-
-3
votes3
answers386
viewsThe user will have 3 attempts to set the password
The following form does not open when the password is correct and if it is wrong continues to pass even if the password has typed 3 times. private void btnEntrar_Click(object sender, EventArgs e) {…
-
-3
votes3
answers58
viewsCondition does not contain in Datagridview
Good night. I need to make a comparison between two Datagridview’s and display in a third Datagridview, the lines of the first that is not contained in the second. Below, the image of the two…
c#asked 6 years, 4 months ago Jehan Kheller 1 -
-3
votes1
answer100
viewsHow to use a padleft(11) in a get in the API
This is the method I have in my MVC public async Task<List<FuncionarioViewModel>> GetFuncionariosVM() { string url = $"http://localhost:56137/api/GetFuncionario"; var response = await…
-
-3
votes2
answers70
viewsMODIFICATION AND READING OF DIRECTORIES IN C#
I am developing a C#project, which uses python scripts as an engine (I did not use Ironpython due to its limitations, I work with pandas), what I do is simply run the script through a PROCESS in c#,…
-
-3
votes1
answer89
viewsInstead of displaying text line by line display the whole text
Instead of displaying text line by line display the entire text. Visual Studio Community 2017. Stream entrada = File.Open(varexe + "\\Score.txt", FileMode.Open); StreamReader leitor = new…
c#asked 6 years, 1 month ago Malyster Snur 7 -
-3
votes1
answer80
viewsUpdate Cdus from coin table
I am developing an application to integrate with Spring ERP V9 and when for the currency table/object and I cannot update the Cdus by the following code. if (currencyId != 0) { currency.EmModoEdicao…
c#asked 5 years, 5 months ago acamiloMoz 69 -
-3
votes1
answer75
viewsIf no search by value
There is a snippet in my program that looks for a specific string to assign a value to some variable. However I am not able to run these parameters inside the "If"... Debugging goes through this.…
-
-3
votes1
answer216
viewsSpring V10, Extensibility, how to use the function: this.ContextService.Articleprices.Getedita(Dynamic Index)
In Spring V10, in API Extensibility: I have a Customtab in "Article Sheet" I need to access the article/currency currently being edited in the form. I use the instruction:…
c#asked 5 years, 2 months ago José Mendes 1 -
-3
votes2
answers176
viewsRun Modal Code Behind ASP.NET?
I’m trying to run a modal through ASP.NET and I got it; Using the Script <div id="mymodals" class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div…
-
-3
votes3
answers507
viewsHow to merge two Pdfs into Base64 in one
I have the following scenario: I receive two files encoded as Base64, each representing a pdf. I need to read those files and turn them into a single encoded file like Base64. Input example: PDF1 =…
-
-3
votes1
answer57
viewsFORM C#: HOW TO NOT LEAVE TEXT BOX FIELD WITH DOUBLE VARIABLE VALUE IN BRACO
**Good afternoon, I’m running a basic program to improve programming but I’m having an error here, I’ve tried several ways and I can’t. It is a IMC calculation program in Windows Form, but when the…
c#asked 4 years, 7 months ago Cledson Paranhos 1 -
-3
votes1
answer151
viewsHow to pass a url variable in web api that contains / or a question mark?
I am developing an api in . net core and noticed that in the url if I want to pass for example https://localhost:44365/api/values/test=?/ or https://localhost:44365/api/values/test=// An error…
-
-3
votes1
answer64
viewsREAD XML IN ASP.NET CORE
Great, I’m working on a project that consists of reading XML files, but I have a problem. The XML file has several subchilds. <?xml version="1.0" encoding="utf-8" ?> <products>…
-
-3
votes1
answer69
viewsInsert into database in C#
I’m a beginner in the area and I need to make a select in two tables of the SQL server database through C#, as shown below: ("INSERT INTO entrada_2(id_entrada, id_saida, descricao_entrada, data,…
-
-3
votes1
answer51
viewsError in Validationresult when trying to create Migration
One or more validation errors were detected during model generation: Sigma.Infra.Data.Context.ValidationResult: : EntityType 'ValidationResult' has no key defined. Define the key for this…
-
-3
votes4
answers109
viewsDefine the lowest and highest value among three numbers
I’m trying to create a program in c# using windows Forms where it gets 3 numbers and tells me which is the biggest and which is the smallest, but I’m really very beginner and I don’t think where…
-
-3
votes1
answer56
viewsHow to make two Join Inner in one table?
CREATE TABLE FUNCAO ( ID_FUNCAO INT IDENTITY(1,1), NOME_FUNCAO VARCHAR(100), SALARIO VARCHAR(100), DATA VARCHAR(100), CONSTRAINT PK_FUNCAO PRIMARY KEY (ID_FUNCAO) ) CREATE TABLE DEPARTAMENTO (…
-
-3
votes1
answer92
viewsAssign Value to a variable that the user puts C#
I am learning C# (Good at the beginning of learning) and I saw that anything that the user inserts by "Console.Readline();" is considered as a string automatically by Visual Studio, but how do I…
-
-3
votes1
answer43
viewsHow do I get randomly generated piranhas to move to the propeller? UNITY C#
Well I need randomly created piranhas to move towards the helicopter and in contact cause a damage (reducing the player’s life). this is the Spawn code with random location. using…
-
-3
votes2
answers27
viewsUnity Nullreferenceexception: Object Reference not set to an instance of an Object Player.Update() (at Assets/Scripts/Player.Cs:22)
I am new to Unity and have already written the code and according to the tutorial I saw but not solved using System.Collections; using System.Collections.Generic; using UnityEngine; public class…
-
-3
votes0
answers14
viewsVisual Studio Different Options
I’m taking an API creation course, but when creating the project the options that appear in the course are not available to me. OBS... In the installation I put all the packages of C#,WEB,. NET.…
-
-3
votes0
answers24
viewsHow to print the array with added data
I’m creating a parking console app to train how to use c#, but I’m having an error when displaying an array of customer data lists that I add to it, I tried to change the interpolation I did but the…
c#asked 3 years, 3 months ago Rogério Chaves 1 -
-3
votes1
answer20
viewsSend more than one checkbox value using Jquery.Multiselect
I was able to send the values of a checkbox to the controller using the function below: function InformacoesAdicionais() { var listOfRegiao = []; $.each($("#select-regiao option:selected"), function…
-
-4
votes1
answer1531
viewsWould it be possible to pass a string from one form to another?
Imagine a Form who asks you for a color, so would have a TextBox, and from that TextBox I wanted to press the button "OK" for example, this sends the text of that TextBox to another Form, so that it…
-
-4
votes1
answer71
viewsComplicated program
I’ve been trying for a while to make a program that does the following: Ask a user to enter a number amount and then to enter the number amount he wants to have in the combination and then the…
-
-4
votes2
answers448
viewshow to send input value to control using querystring Asp.net?
I have this code on View @using (Html.BeginForm("VisualizaJogoParaExclusao", "Relatorios", FormMethod.Post)) { <div class="row"> <div class="span12"> <input class="form-control…
-
-4
votes1
answer202
viewsHow does this class work?
DataSet OleDbConnection OleDbCommand OleDbDataAdapter OleDbDataReader I still can not understand this class in .net. What are these datasets and etc? I’m wearing this: using System; using…
-
-4
votes1
answer113
viewsWhat’s wrong with parole?
What the error in the parole below and how to resolve? private void Botão_Click(object sender, EventArgs e) { if(Pbox.Show();) Pbox.Hide(); else(Pbox.Hide();) Pbox.Show(); } private void…