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
votes0
answers36
viewsDoubt Session Asp.net
I need to pass a user’s id through a session, because it’s happening to mix users, because it was being recorded in a variable, has some way, to continue going through the variable, without having…
-
0
votes0
answers127
viewsCreating project templates in vs with existing projects
I’m trying to create a project template in vs 2017 using the SideWaffle, the problem is that it references existing projects in separate folders. ex: sln: project A project b libraries project…
-
0
votes1
answer145
viewsError in accent words using Httpcookie
My Cookie Retrieval Method is Bringing You Words With Disfigured Accent. //Para gravar um Cookie private static void Set(string key, string value) { var encValue = value; var cookie = new…
c#asked 6 years, 7 months ago Andersson OS -
0
votes0
answers64
viewsWhat folder structure for the dll project in . net framework that I will play in the main project
I have a vs2017 solution with a main project that will use a dll project as a reference. I created the model, business and repository folders in the dll project Main project use a dll in the main…
-
0
votes1
answer651
viewsFilter a NULL type in lambda Expression or Line
Hello, my entity To has a long type attribute that can be NULL making relationship with the entity B, by making a filter with a Lambda expression with this attribute to bring all records that are…
c# asp.net-mvc linq asp.net-web-api lambda-expressionsasked 6 years, 7 months ago Thiago Ubiratan 353 -
0
votes1
answer299
viewsGenerate table automatically with c# and mvc
how to do the following (I don’t have code yet). On the page, I have a table with a Row and 5 Columns and at the end of Table a button (+) and at the bottom of the table a save button. The question…
-
0
votes1
answer46
viewsDate format c#
I need to format the date to Apr 06, 2018. Code that I have: DateTime joinDate = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Group.GetGroupJoinInfo(Group.Id));…
c#asked 6 years, 7 months ago user89739 -
0
votes0
answers238
viewsXamarin.Forms Android Error - new Httpclient()
This error (image) appears whenever you arrive on this line: using (var client = new HttpClient()) This is the complete code. using Newtonsoft.Json; using System; using System.Collections; using…
-
0
votes1
answer115
viewsHow to Interact from Web Application to Client Machines
I have a web application on ASP.NET MVC which is an intranet project. I would like to add some features to it to make it easier to work with Backup’s. I already have one WIDNOWSFORMS APPLICATION…
-
0
votes1
answer341
viewsHow to concatenate a list of an object into a property of another object?
I have the following model: public class Usuario { public int idUsuario { get; set; } public string Nome { get; set; } public string Email { get; set; } public string Senha { get; set; } public int…
-
0
votes1
answer25
viewsHow to not save value in the list if(seal)
i have a foreach running through my list and I want if() to be true it shows a message saying that there is already this value in the list and DON’T STORE this value on the list, someone knows how…
c#asked 6 years, 7 months ago Guilherme Schubert Medeiros 45 -
0
votes2
answers2572
viewsHow to change button color using RGB or Hexadecimal code?
I have a Winforms application and would like to use colors that are not in the presets of the object Color, how could I do that ? By way of example: How the code is found: this.btnLogout.BackColor =…
-
0
votes2
answers1675
viewsValidating Login
I’m trying to log in, but I’m not able to do one thing. I first check that the user and password fields are filled in. So far so good. I then check that the password and the user are correct. And in…
-
0
votes0
answers47
viewsCall error of a Python application (+Opencv) in Visual Studio 17 (C#)
I’m trying to make a "control panel" that each button will call a Python application(+Opencv) but when I run it through the Pycharm IDE, or straight from the folder, it runs perfectly, but when I…
-
0
votes1
answer242
viewsHow to share a webservice through an FTP?
Contextualization I’m developing a C# application to access a test webservice I created. This webservice is simple, it only has a method that returns a string. The webservice I created by Visual…
-
0
votes1
answer909
viewsHow to map the return of a Value Object with Dapper?
Hello! I have a question related to the return of an object with an already filled 'Value Object', example: I have the User.Cs class. public class User { public Guid UserId { get; set; } public…
-
0
votes1
answer380
viewsHow to get value from an Html.Editorfor
I have the following command @Html.EditorFor(m => m.DataDoDesligamento) In it is placed a date, and when clicking on a button should redirect to a report, only that I need to pass the parameter…
-
0
votes2
answers140
viewsValidate a string with Regex
I need to validate the name of a file that has the following name NWD[0-9] PADRAO -. The literal part will always be the same, what may vary are the numbers. I’d like to know how to do that with…
-
0
votes1
answer1958
viewsConnection to SQL database in C#
Good morning friends, I am doubtful about database connection in particular for use in a project that captures database information for a Datagridview, my first problem is that table information is…
-
0
votes1
answer132
viewsError in creating SQL Server table with Entity Framework
Delete a table from my project directly in Management Studio. Now when I run the application this error is returned: system.data.sqlclient.sqlexception: Nome de objeto 'dbo.ContasPagarParcelas'…
c#asked 6 years, 7 months ago Gilberto V. Gonçalves 43 -
0
votes1
answer45
viewsView Form in a Tablelayoutpring C#
How do I open a form named frmOrcamentos within a TableLayoutPanel so-called tlpPrincipal. Remembering that the form frmOcamentos will open in the TableLayoutPanel that is inside the form…
-
0
votes1
answer67
viewsView photos by Repeater with sql server Using split
I’m not able to upload the photos in repiter making a carousel coming from the data bank, I can not find anything on the web related to this problem follows the Cod ASPX Imoveldetail <section…
-
0
votes1
answer1213
viewsChange date format on C# / Asp.NET server
I’m having a very boring problem, I’m picking one up DataDeCadastro of the server on DateTime when the date well it is in the United States version ("dd/MM/yyyy") I use the .ToString() to format the…
-
0
votes2
answers131
viewsWhich component can I use as a table in c#?
[SOLVED] I got two information in the database, table products: ID and name. I need to show the user the ID and the name of all registered products.. The problem is that the listbox is just a list,…
-
0
votes2
answers539
viewsFind consecutive numbers in a string in C#
I wonder if there is a simple way to find consecutive numbers (which are equal) in a string, so that it is possible to replace that string with a single value. For example: string input =…
-
0
votes0
answers63
viewsSave value from a variable within a controller to use in another DLL run method
I need to save information in the User Login and use this information in another DLL. EX: Projeto.Web Projeto.Domain.dll When logging in the User Project.Web controller, I need to save which project…
-
0
votes2
answers518
viewsAjax always falls into 'error' even when successful (C# MVC5)
Come on. I have the following method: C# [HttpPost] [AllowAnonymous] public JsonResult PostOnCRM(string textBoxFirstName, string textBoxCountry, string textBoxLastName, string textBoxEmail, string…
-
0
votes0
answers54
viewsError while converting null integer
I’m making a conversion of a value int: int.Parse(detalhe.GANO_ID_ATIV.ToString()) But you’re giving me a mistake A cadeia de caracteres de entrada não estava em um formato correto. What could be…
-
0
votes1
answer807
viewsCreation of a Shopping Cart
I want to create a Cart, where you have the Products that I will sell, the quantity and the total value. Does anyone have an idea of how I can start development? Just for clarification, follow my…
-
0
votes0
answers255
viewsValues with 3 decimal places entering erroneously
I have a textbox in which I inform a value of an item that must be divided to 10 people registered in the system, but that are divided by proportion, who has more item receives more of the new value…
-
0
votes1
answer743
viewsDecimal places in C#DGV
Here are 2 images that summarize my problem. Screenshot of db (Access) Image of the Datagridview When launched values with decimal places "0" the DGV does not show, Ex: 1.00 = 1 1.50 = 1.5 Follows…
c#asked 8 years, 1 month ago Maurício Sanches 487 -
0
votes0
answers83
viewsSpecial string character deletion does not work. c#
I have this string: EM RECUPERA�?�?O This string comes to me in a XML and I use the following code to treat that: byte[] bytes = Encoding.Default.GetBytes(xmlRetorno); xmlRetorno =…
-
0
votes0
answers207
viewsDisplay data from an ID in the table in a textbox - C#
I need to make one select in the database to capture the id of the last product registration, I will make an increment and show it in a textbox on my registration form. My intention is to show the…
-
0
votes1
answer320
viewsWhat is this and when and how to use it?
I wonder what makes this and how and when to use it.
c#asked 6 years, 7 months ago victoriaFreak 69 -
0
votes1
answer284
viewsDifference between Addmvc vs Addmvccore
In some examples I’ve been following, I’ve found two calls on Startup of applications in asp.net-core Addmvc: public void ConfigureServices(IServiceCollection services) { services.AddMvc() }…
-
0
votes0
answers38
viewsGenerate Object with values from a Resource file
I have a Resource File with the following values: Name: Value: Teste1 TesteUm Teste2 TesteDois And I read it like this: ResourceManager rm = new ResourceManager("MyResource",…
c#asked 6 years, 7 months ago Jhonatan Jorge de Lima 1,012 -
0
votes1
answer304
viewsObject List(with some objects as attributes) for Datagridview - C#
How do I show the Street or Zip Code of the list below in Datagridview. People’s List (to display in datagridview) List<Pessoa> Pessoas; Classe Pessoa using System; public class Pessoa {…
-
0
votes3
answers49
viewsSend information from a Viwer Data grid to sql database
I’m putting together an order form using c#. The problem is that when I try to send the products that are listed in the Data Grid Viewer to the database, the program reads only the line where the…
-
0
votes1
answer25
viewsHow to get the class value of a div that is inside a Repeateritem?
Below the simplified code: Current behavior 1. When Clicking on "divOnoff", the class of the div "divAtivoOnOff" alternates the value at each click between "Onoff on" and "Onoff off". How to store…
-
0
votes1
answer144
viewsColor status in gridview Asp.net C#
I need to make the text of the exam status of an app appear in different colors, in case wait black, marked green and not performed in red, these status are in an Enum. Follow my code, if anyone…
-
0
votes1
answer238
viewsHide form fields that will be required
Hello, I have a form that depending on what will be selected in a select will hide or display fields. The problem is that some of these fields will be of the type required and Submit will not…
-
0
votes1
answer250
viewsmake a button to end user session (Asp)?
People I’m developing a site that allows the user to Log into his account and such, but I need q after q he Log this login button to disappear and appear one to end the session (a quit button).…
-
0
votes2
answers111
viewsIs it right to use string when the value is integer?
Today I came across a certain situation that left me in doubt: In my application I have some ID's from a table, these ID's are integer values (1,2,3, and so on) and I treat them all as string. One…
-
0
votes1
answer150
viewsDoubt about the Messagebox
I have a question about our famous MessageBox.Show();, this command is an event, method what would be?? Another question is about instantiating object, in the example below we are taking our login…
-
0
votes1
answer498
viewsHow to send a character(char) via bluetooth
I’d like to send the number 1 via bluetooth on android, already made the part of connection to send - this is the source code public void conectar(ProgressBar loading, BluetoothSocket socket) {…
-
0
votes0
answers113
viewsQuery takes time to complete
Good afternoon, you guys, am having a problem executing a query in c# using NPGSQL. try { bdConn.Open(); NpgsqlCommand sql = new NpgsqlCommand(); sql.Connection = bdConn; sql.CommandText = query;…
-
0
votes1
answer168
viewsCalling an . exe application in a C#Panel
To open an application know you use the following code System.Diagnostics.Process.Start("calc"); Now I need to know how to open the application in a Panel in my Form, so that it is not possible to…
c#asked 6 years, 6 months ago Giovani Rodrigo 299 -
0
votes1
answer739
viewsLINQ Return from the list is with all the repeated records
I’m having problems performing a select (using LINQ) in a View in SQL Server 2012. The values stored in the bank are as below: ID_Acomp ID_Pessoa Nome Data 26 300 MONTEIRO 01-01-2016 27 300 MONTEIRO…
-
0
votes1
answer234
viewsSeparation of Identity Bank from Application
When using Asp.net Identity, a single bank is generated. And it is recommended to leave this bank only for Identity and create another bank for your application, as I read in some articles. So far…
-
0
votes1
answer749
viewsSaving fields with comma
What I need to do to save in a field currency-like values with the comma and send to the with the comma. As I declared the price field in the bank: preco number(12,2), Code: class clnPrato { private…