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
votes1
answer221
viewsConsult by Date
Well I am using the EF with the following code to query it brings the query by name and type but by date not, since the time is not in my filter with the time 00:00:00 it brings correctly the time…
-
0
votes0
answers106
viewsCreating properties in all WPF windows
Anyone has any idea if it is possible to inherit from the WPF Window class, create some properties and when creating my screens instead of making them inherit from Window make them inherit from this…
-
0
votes0
answers112
viewsOverlay items in Listview
Good morning! I have an app android implemented in c#. This application displays a "list view" with the products. Each product has information that can be viewed by clicking on the "V" button and…
-
0
votes1
answer721
viewsStore data set values in ASP.NET variables
I’m having trouble storing the return of a select in variables , I’m using a data set to create a table with the result of select , this select will return me some records and the form I’m making so…
-
0
votes0
answers530
viewsUnable to find table 0 ASP.NET
I’m developing a screen that exports processed data from a Procedure for PDF/Xls. Debugging it returns the following error: Unable to find table 0 From what I understand he can’t read the…
-
0
votes1
answer324
viewsC# - Passing data between Windows Form using Listview
I have a project in C# Windows Form, in my project I have 2 screens, 1 - Listview to show the information, 2 Form to get the user data and pass to Form1 Listview, but the problem is: pass the…
-
0
votes4
answers488
viewsHow to treat this Nullreferenceexception
I don’t understand why I’m getting one NullReferenceException, in that beautiful code: pessoaJuridica.InscricaoEstadual = viewmodel.PessoaJuridica.InscricaoEstadual; What I’m doing wrong? Follows…
-
0
votes1
answer201
viewsc# with javascript catch image src using Mousedoubleclick cefsharp
<html lang="pt-br"> <head><title></title></head><body><img id="1" alt="1" src="http://www.imagenspng.com.br/wp-content/uploads/2015/06/imagenspng_logo4.png"…
-
0
votes1
answer588
viewsExtract attributes from an XML in a SOAP message
I am building a Webservice that returns status of an object, so I get the data of the object to search in the base via SOAP message: <soapenv:Envelope…
-
0
votes1
answer75
viewsEF 6 - Migrations does not reflect changes in entities
I changed my entities and I turned the command Update-Database -Verbose -Script only to see in SQL what changes would be made. Generated the legal script with all changes. I closed the script window…
-
0
votes1
answer56
viewsHow to select a string in resx (internationalization) without using the static method
I have . resx files where I store strings in English and Portuguese, in my database I have the following table: And I want to change the description of the plans equal the first record of this…
-
0
votes0
answers78
viewsHow to determine if string is strictly decimal?
I would like that if the string has the comma (as we use in the Brazilian real to represent the decimal places), it returns true and if not, return false. Example: "1" = false; "1,00" = true; "10" =…
-
0
votes1
answer964
viewsData of a Datagridview configured in another Form
I have the Form1 who owns a dataGridView and a button to add content to this Grid. By selecting this button, I call Form2 which has 2 Textbox and a Combobox to fill in the Name, Directory and Format…
-
0
votes1
answer83
viewsError trying to register
Good afternoon, the moment I try to register in the form, I program in the language c# with Asp.net, Razor and Nhibernate. This is my DAO public IList<Rota> Comparacao() { //*string hql =…
-
0
votes1
answer592
viewsSwap background color and item text in Gridview
I have a GridView with multiple numbers and I have a click event on the items in this GridView. I would like the items that have already been clicked to change the background and text colors to show…
-
0
votes1
answer97
viewsError: Could not parse type 'xxx[]' because it does not have any known mapping to the value layer
In the controller I have my session built. public const string ListaPermissao_SessionName = "ListaPermissao"; private List<ListaPermissao> ListaPermissaoEnvio { get { if…
-
0
votes0
answers434
viewsI need to pick up and display a list of client objects by Id
MY CLASS CLIENTEBUS class ClienteBus:AplicacaoBus<Cliente> { public ClienteBus() { Tabela = new List<Cliente>(); } } MY CLIENT CLASS class Cliente:Entity { private static int _Id; public…
-
0
votes2
answers310
viewsDynamically mount Timeline in html on page . aspx
I would like to ask a little help from the forum, to mount a dynamically html Timeline using the Asp.net font-end or code Behind C#, in a SQL-based Web Forms application. I need to assemble I…
-
0
votes2
answers488
viewsC# - XML Serialization error
I came across this error when trying to load an XML file through three scripts: One called Item, one Itemcollection, and the script to load the XML file. Item: using System.Collections; using…
-
0
votes0
answers75
viewsPass lambda expression to another class run C#
Can you pass a lambda expression to a class, and then execute it ? Something like code below. Giving error in the expression select new Error: Error 1 Cannot implicitly Convert type…
-
0
votes0
answers376
viewsHow to save on a relative path?
I have the following method: private string SubirImagem(string imagemupload, string sequencia, string clifor) { HttpPostedFile imagem = Request.Files[imagemupload]; string nomeimagem = ""; if…
-
0
votes1
answer1157
viewsHow to take the contents of an HTML Table and convert into a C# List<>?
I have a table html which is created dynamically by the user. I need to take all the data entered by him in the table and generate a List to be able to save later in a database. Below are project…
-
0
votes0
answers59
viewsStream that reads byte per byte?
I created a simple byte-by-byte reading method in a stream, but it’s very slow and it’s taking minutes to process a ten-megabyte file, I don’t know why it’s so slow. It needs to be byte-by-byte and…
-
0
votes1
answer140
viewsDropdownlist The Name '' does not exist in the Current context
I have a gridview that lists the countries and depending on the selected list the cities of that country. <asp:GridView ID="gvRentalVendor" runat="server" AutoGenerateColumns="false"…
-
0
votes1
answer59
viewsAfter Login, how to pass value to the view
After logging in, the user is directed to the page Home and on this page, I would like to show a Label with the client code to which the user belongs. So I went to the table AspNetUsers added a…
-
0
votes0
answers79
viewsDropdownlistfor creation with typed view
Good afternoon, everyone, I’m starting my studies in the art of ASP.NET C#. I’m having trouble creating a Dropdownlistfor. Like I’m doing: - I’m using ADO.NET - I have my model Equipment - I have a…
-
0
votes1
answer80
viewsHow to recover parameter from a Controller
After the user logs in, two parameters are passed to Controller Home: case SignInStatus.Success: { //recupera as informações do usuario que corresponda ao usuario e password var user = await…
c# asp.net-mvc-5 parameters asp.net-identityasked 7 years, 4 months ago Thomas Erich Pimentel 3,059 -
0
votes1
answer288
viewsApi receiving date with changed month and day
I have a class: public class Filtros{ public DateTime DataInicial { get; set; } public DateTime DataFinal { get; set; } //outros campos... } I have a C# API that takes the class:…
-
0
votes0
answers33
viewsWindows does not show newly inserted files in a directory of a real android device /sdcard/Download/
I have an Android application that I import an Sqlite file into the application to perform the queries and changes. When finished manipulating I export that same file to a user-accessible folder so…
-
0
votes1
answer71
viewsError in encryption program c#
Hello, I am trying to run my program done in c# with Windows application, but it is giving a build error that I am not able to solve. I thank anyone who can help me ! Thanks ! ( The error is…
-
0
votes1
answer1006
viewsBootstrap Modal Change and Ajax ASP.NET?
I developed a basic functionality in the Asp.net MVC controller where I have a product list and it is changed in the Back-End and in the front-End I use the Bootstrap-Modal to load the product and…
-
0
votes1
answer43
viewsHow can I capture Exception from Circuitbreaker (Polly) and generate a log?
I’m trying to capture through Action onBreak, but apparently it never launches Exception on screen. using Polly; using System; using System.Collections.Generic; namespace CircuitBreakingPolly {…
-
0
votes1
answer496
viewsCheck for list records in the Entity framework
I have the following code: var ret = Monitoramento.List .Include(p => p.CD) .ThenInclude(p => p.CargaEntrega) .ThenInclude(p => p.CargaEntrega.Motorista) .ThenInclude(p =>…
-
0
votes1
answer104
viewsError when using GROUP via LINQ
I’m trying to perform the query below: var query = from s in db.Crm_Analise where s.cliente_CRM == cod_cli group s by s.TAG into g select new { TAG = g.Key, ATUALIZAÇÃO = g.Max(t =>…
-
0
votes1
answer378
viewsMessage when it exceeds Fileupload size
I’m trying to put a message for when it exceeds the file size in Fileupload, already arranged inside the web config, but always returns me the following error: Maximum request size exceeded. I saw…
-
0
votes3
answers849
viewsLinkbutton : Open link in a new window (Right Mouse Button)
I wonder if there is any way I can open a new tab by right-clicking, or middle-clicking... I’m using the "LinkButton" but the command occurs within a OnItemCommand="ListaMenu_ItemCommand". Aspx :…
-
0
votes0
answers205
viewsSave a byte array to sql from a Datatablereader
In one of the system tasks, I need to query an Sql Server database, which returns a Datatable, in this Datatable, one of the data is of the type Byte[] So to read the Datatable use a…
-
0
votes1
answer488
viewsDelete a foreach and replace the result in a lambda expression in a method
It’s pretty simple stuff. I have a method that takes a name inside a database and compares it with the parameter passed in the method and be equal, return it in the method, otherwise return a…
-
0
votes1
answer71
viewsPopular Gridview with Access Data
I managed to do this in VB.NET, but now I need to do it in C#and I can’t turn the code the right way. I have this Gridview: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"…
-
0
votes1
answer197
viewsHow to set the line height of an Excel in NPOI?
I am trying to create a line in an excel file through the library NPOI. The problem is that I don’t know how to set a line size. Currently, the line is covering the text content. How can I set the…
-
0
votes1
answer685
viewsHow to increment a string variable c#
I have been developing a new application I really need to increase the variable public string malcoins = "0"; good to begin I will not be able to put the code all because it is very big and here…
c#asked 7 years, 4 months ago Helder Da Silveira Ventura 125 -
0
votes1
answer415
viewsC# Visual Studio unknown build error
I went to refactor my code in C# that was working perfectly, but it was gigantic, and it stopped working and the visual studio does not describe the error in any corner. Below is my code and Visual…
-
0
votes1
answer168
viewsXamarin Method 'Plugin.Geolocator.Abstractions.IGeolocator.Getpositionasync' not found
You’re making a mistake for me: "Method 'Plugin.Geolocator.Abstractions.IGeolocator.Getpositionasync' not found" In IOS version is working well, but on Android could someone give me a hint? It’s my…
-
0
votes0
answers275
viewsHow to capture the body value (Stream) of a request without deleting it?
I’m trying to capture the body of a request in an authorization class (Authorizationhandler), but because this body is a Stream, after reading its contents the post request that comes next can not…
-
0
votes0
answers75
viewsAlign Bar Graph, c# using Novacode
How can I align my bar chart in the center of my docx document? My code: using Novacode; //adquirido na extensão DocX namespace WF_TermograFacil { private void button1_Click(object sender, EventArgs…
-
0
votes0
answers558
viewsXamarin Forms - Select and display Images
I am developing an application in Xamarin Forms and I am in need of a functionality in which the user can choose an image from the gallery and that this image can be displayed in an Image control in…
-
0
votes0
answers157
viewsHow to connect to Postgresql database using Xamarim
I’m creating a mobile application using the Postgresql database, but I can’t open the connection: My code: public class PgSql { private string connString = "Server=192.168.1.5;Port=5432;User…
-
0
votes1
answer892
viewsC# - Can’t map HERITAGE with Entity Framework Core - Code First?
I’m not able to map the Person and Client classes (Table Per Type (TPT) using the Entity Framework Core), Customer inherits from Person. How do I do? public class Pessoa { public int PessoaId { get;…
-
0
votes1
answer644
viewsC#, Returning an Sql Server query in Data Grid View
I have a bizarre problem, I have a table in the database Sql Server, where there is a field bit, I’m pulling data from this table, which is actually a View. I do my instruction Select, and executed…
-
0
votes1
answer51
viewsDoes Linq generate this ID? How to recover?
I’m doing an automation using Selenium Webdriver and I’m taking all the elements of a Table. I used the code below: var qntd= driver.FindElements(By.XPath("//*[@id='dataTable']/tbody/tr")).Skip(3);…