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
votes2
answers80
viewsModal does not open after using $('.modal-backdrop'). remove()
I am working with Webform, using Masterpage. My daughter is inside the Updatepanel, via c# I call opening a modal within another modal, only that each modal opening darkens the background, and when…
-
-1
votes1
answer33
viewsList box detects that iteam is being selected
I want when I double click on the listbox item, when start it do an action, when I double click on any other item it do another action. Code: //btnWhenClicked private void btnWhenStart_Click(object…
-
-1
votes1
answer76
viewsselect data from a sql server database in C#
I made a precedent that takes all the data from all the columns of my sql table of interest, in my Asp application in c# I can put all the rows in a list ,but I need to refine this search by taking…
-
-1
votes1
answer68
viewsList of DB clients on the program page in C#
My problem is this, I do not know how to make appear on the user screen a list with limit X of clients of a DB, I will try to put in topics for a better understanding 1 - The customer list should…
-
-1
votes1
answer372
viewsLocation.href is not transferring me from ASP.NET MVC page
I am making a login screen in ASP.NET MVC. The framework does all the complete processes without errors: goes to the database, queries the login and comes back with an OK (user exists, I can…
-
-1
votes1
answer446
viewsC# Transpose Columns in rows
In C# - Linq: I have a List of objects: Field 1 | Field 2 | Field 3 | Field 4 | Field 5 | Test | 15 | 20 | 45 | 52 | I need to transpose this line from a collection to an integer list 15 20 45 52…
-
-1
votes1
answer210
viewsSkype bot detects when receiving message
Here’s the thing I’ve been looking for how I can make a bot that responds when I receive a message from someone, I found a tutorial but I couldn’t get the bot to respond despite the bot responding…
-
-1
votes1
answer446
viewsHow to know if foreach is going through the last item on the list
I created an application in console and a foreach to go through my list of integers: var lista = new List<int>() { 2, 6, 1, 4, 20, 21}; int count = 0; foreach (var item in lista) { count++;…
c#asked 6 years, 9 months ago Samuel Renan Gonçalves Vaz 720 -
-1
votes1
answer1783
viewsWebmatrix - CS0103: The name 'Viewbag' does not exist in the current context
Good afternoon! I’m implementing a Web Matrix application. My page is in . cshtml (c# with html). I want to use the Viewbag Class, but I can’t find it in @using System.Web.Mvc; nor elsewhere. I…
-
-1
votes1
answer93
viewsGet the ID value in Datagridviewe C#
I have a datagridview and in this grid there is data associated with a database table, so I wanted to take only the id of the value that is in the datagridview, and play in a property of type int…
c#asked 6 years, 9 months ago Danillo Victtor 539 -
-1
votes1
answer200
viewsHow to know the license of a given module in ERP SPRING V9
Is there any method in the SPRING ERP V9 API to know if a particular client has a bank license?
-
-1
votes2
answers2304
viewsHow to read three values in the same line? C#
How can I put three values on the same line separated by space in C#? And then work with them? Problem: https://www.urionlinejudge.com.br/judge/pt/problems/view/1079…
-
-1
votes1
answer39
viewsHow can I make an if if Database data is True or False
How can I make an if by checking whether the data of a column in the Database table is True or False? For example: using (SqlCommand cmd = new SqlCommand($"SELECT LoginID,Award FROM…
-
-1
votes1
answer964
viewsRelationship of two tables MVC C#
How can I make a Lambda query, I have two Permission and Employee tables, where to inform the email of the Employee, he brings me the Employee’s permissions, through the email that I informed. In…
-
-1
votes1
answer77
viewsSystem.Nullreferenceexception was unhandled by user code
When compiling my application I received this error from the image below, would anyone know how I could solve?
-
-1
votes2
answers50
viewsHow to create a built-in validation screen?
Excuse me if the title is not so explanatory, but the doubt is as follows: I have to do a CRUD and I already managed to do the C and R, but I am doing the page of Update now and the scheme is more…
-
-1
votes1
answer677
viewsBiometric Reading
I am developing a desktop system, where I wanted to register a biometric. I use the reader Futronic Modelo: FS80H. I’m new to . net The idea is to save biometrics in format String to be later saved…
-
-1
votes1
answer340
viewsError passing parameter to proc with Dapper
I got it inside a foreach: parameter.Add("@PROD", item.CDProduto); parameter.Add("@Filial", item.filial); parameter.Add("@Cod_Oper", cod_oper); var result =…
-
-1
votes1
answer222
viewsError calling a method in ASP.NET Web API and Ninject
I am getting error while trying to call a method from a Web API. Declaration of the method in ApiController public class AcessoController : ApiController { [HttpGet] public UsuarioModel…
-
-1
votes1
answer194
viewsWhat is the !=?
What is the purpose of the != in C# and how can I use it properly? I visualized an example in a repeat structure with for, however I did not understand very well the function of it. int soma = 0;…
c#asked 6 years, 7 months ago user109093 -
-1
votes1
answer55
viewsPossibility to use MAX in Datetime Lambda expression fields
There is the possibility to use the MAX in expression consultations lambdas, for example: I would like to take all registration at the age of 18 years and get the only last record entered in the…
-
-1
votes1
answer106
viewsField validation
How could I validate the fields below so they don’t go blank, because my biggest difficulty is that two of them have Convert. NegocioFuncionario neg = new NegocioFuncionario(); EntidadeFuncionario…
-
-1
votes1
answer535
viewsRelational Order Tables in C#
Good morning Guys, I am developing an order screen where will be added products to compose the request, but I can not imagine a way to save the order items in a table, how could relate the product…
-
-1
votes1
answer170
viewsCheck certificate X509certificate2
Is there any way I can verify that the A3 certificate is connected to the computer? Some kind of validation for example. I work with an application that makes use of A3 certificate, but I do not do…
-
-1
votes3
answers380
viewsPrint a string with only numeric values
I’m doing a show in console where the user enters some codes, and I want to print this code back to him just when he gives enter. But I wanted to print only the number values and ignore the…
-
-1
votes1
answer578
viewsConnection String C# Entityframework
Would continue a project of work at home, the Connection String that works is as follows: <add name="DBModel" connectionString="data source=PD_22;initial catalog=EXERCICIO_ENTITY_JOSEEDUARDO;user…
-
-1
votes1
answer644
viewsEntity Framewor Core Database.Setinitializer
The Entity Framework Core has the Database.SetInitializer()?
-
-1
votes1
answer210
viewsHow to create a basic browser only to run built-in Javascript codes
How can I create a basic browser in VB.NET or C# and run Javascript code inside it, and without showing the code? 'Cause I wanted to hide my JS code.
-
-1
votes2
answers101
viewsLinq equivalent to the t-sql command
How to make the LINQ equivalent to the following SQL? Select sum(case when periodo = 1 then isnull(valor,0) else 0 end) Jan, sum(case when periodo = 2 then isnull(valor,0) else 0 end) Feb, sum(case…
-
-1
votes1
answer58
viewsError that is occurring
<td> @Html.ActionLink("Editar","EditarPessoa", new { cod=item.Id }) | @Html.ActionLink("Details", "Detalhes", new { cod=item.Id }) | @Html.ActionLink("Deletar","DeletarPessoa", new {…
-
-1
votes2
answers256
viewsConfiguration file for C# Winforms
Is there any way to create a file where I can set for example a color with the name 'Background' and add the value '#fff', then use it in all my Forms, similar to a style of CSS, so that if I need…
-
-1
votes1
answer88
viewsFind the largest number in a text file
I’m trying to make a program that reads a text file and tells me the highest number in it. Here’s what I got from the code: while (sLine != null) { sLine = objReader.ReadLine(); if (sLine != null)…
-
-1
votes2
answers161
viewsChange the "Web Reference URL" of the Webservice added by add web
I wonder if it would be possible and how to make this change by taking the web address.config…
-
-1
votes1
answer75
viewsAccess to client directory
I have a curiosity, someone can tell me if there is any way to make my web application (in the case ASP .Net core) able to let the user choose a folder on his local machine and, my application have…
-
-1
votes1
answer331
viewsSybase database connection with c#
I have a Sybase database file on my machine, I want to make this database available in my application c#, how I make this Sybase database file available, and how to access this database with c#?…
-
-1
votes1
answer292
viewsConvert 1.0 (string) to 1.0 (double) in c#
Good evening, everyone, I am trying to solve a challenge in C# but when I try to convert two variable string with point (Ex. 1.0 7.0) to two double variables, loses the point and is 10 70. Can…
-
-1
votes1
answer37
viewsTake variable from one form and pull into the other form
Good night, I’m racking my brain on how to take the value of a form and store it in a variable so I can access that value in any other form. I tried already as public Static instantiating but did…
-
-1
votes1
answer56
viewsHow to apply regex , using C# in a pdf file?
private static string BuscaComparacao (string url) { Regex r =new Regex("\S+\D{3}[.]\D{3}\S+\D)"; var result = r.Matches(url); return result[0].ToString(); } the code does not find the data I sent…
-
-1
votes2
answers378
viewsHow to execute multiple commands (cmd) c#?
Good people, I need an application that captures input and output, so that after the execution of a command the same "prompt" is not closed. I can currently execute commands and capture output in…
-
-1
votes1
answer459
viewsExternal connection to sql server by android application, C# xamarim
Good I am in search of information regarding which procedure to access a sql server database by android.
-
-1
votes1
answer809
viewsASP.NET Core - Search for GET requests
I am using ASP.NET Core 2.1 Web API and need to perform searches by certain type of field, IE, on my front I can choose the field I want to do the research and my back-end need to pick this value.…
-
-1
votes2
answers199
viewsMultiline textbox printing last item only
I’m using TextBoxt Multiline to "issue" the report in the system itself. Ta printing, however, appears the following message: "System.Windows.Forms.Textbox" and then the data. public Formulário() {…
-
-1
votes1
answer130
viewsC# problem with MAIN and source
I was making a program in visual studio using the C# link until this error came up and I don’t know how to fix it: and the code was this Any suggestions to resolve this?…
-
-1
votes2
answers100
viewsDoubt with the language C#
I have a String any kind of "chair ". Doubt How do I give a space between all the letters in C#?
c#asked 6 years, 3 months ago Vinicius Caetano 89 -
-1
votes2
answers100
viewsWhy is calling a method not compiling?
using System; using System.IO; namespace testando { public class pessoa { public void Falar(){ Console.WriteLine("Ola meu nome é ninguem"); } } …
-
-1
votes1
answer326
viewsPage cannot be displayed due to internal server error
I’m having this error running the application I only have this, I can’t even put a break point, because it doesn’t even enter the application. I don’t know what to do. This code works on another…
-
-1
votes2
answers83
viewsWhat does each signal mean in this assignment in C#?
mainSize = mainSize < 0 ? 20 : mainSize ; What do "?" and ":" mean within this assignment of the mainSize variable'?
c#asked 6 years, 2 months ago Marcos Barbosa 377 -
-1
votes1
answer76
viewsChoose folder with mvc c#
How do I allow the user to choose the folder in which to write a sheet? The call will be from an Razor view of mvc.
-
-1
votes1
answer54
viewsGenerate txt with standard format
all right? I need to generate a txt file with a default format as below: D00000002 200014002154129 $9997 7720 0000 0012 * 12/19 *CLARICE LISPECTOR *0014-00 215412-9 * %B9997772000000012^CLARICE…
-
-1
votes2
answers211
viewsCapture mouse event
Hey there, fellas! I’m developing a side menu that contains C# submenus, but I can’t find an effective method to display the submenus that are inside a panel. I tried with Mousemove event, however I…