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
answer505
viewsBrowse answer tags from a C#site
I’m performing a query on google by C# and I need to get back from the query the Query Title and the Link of the queries returned. I got my return as follows: public class GoogleSearch { private…
-
1
votes1
answer160
viewsBuild XML File Tip Using xml Serializer - More Efficient Way
I am mounting an XML file whose structure should be have nested tags as the image below: The image above is the output for the code below: public class Feeder { public string Name { get; set; }…
-
1
votes0
answers211
viewsHow to make the enemy turn to the player?
Hello, I’m developing a game in which the enemy follows the player to try to capture him. But he follows the player backwards, face back, or sideways. Is there any way that the enemy follows the…
-
1
votes0
answers87
viewsCreating Azure Cosmos DB Collections
Well I was creating a Poc with Generic Interface for handling my data, but I had difficulties to do with Webapi MVC, I did with good old MVC. But for the whole JSON issue, I think I lose a lot if I…
-
1
votes0
answers35
viewsOpen Gridview2 by selecting a Gridview1 field
Hello. I’m trying to get every time I select a specific field within the Gridview1, open related data in an Access Database on Gridview2. That’s the code on my page. <%@ Page Title=""…
-
1
votes1
answer213
viewsError when connecting to database [Winform/C#/SQL Server]
My C# teacher taught us a new technique today, one does not need to inform Connectionstring itself, the program would go to the document folder and pick up the file . mdf (SQL Server) and open the…
-
1
votes1
answer161
viewsScrollbar centering on its own
I have a form with height larger than the screen, with many buttons and checkboxes, The user uses the scroll bar to scroll down and see all the content of the form. My problem is that every time the…
-
1
votes1
answer168
viewsReturns query value in a variable
Precise returns the value of a query query in an int variable, to be able to make the comparison with my Textbox, but I cannot make the comparison because I cannot compare integer(textbox) with a…
-
1
votes2
answers726
viewsHow to read numbers from a txt file in C#?
This is an example file: 2 0.03159527 0.1990048 0.9794891 0.02173799 0.9969404 0.07508247 The first number indicates how many lines are, for each line are always three numbers I tried to do…
-
1
votes0
answers169
viewsHow to pick up part of an image using bitmap C#
Guys, I’m studying bitmaps, and I downloaded a pdf that said an image was an array of pixels. Since it is a matrix (which is quite logical) there is how to define points within the image, mark a…
-
1
votes1
answer27
viewsMigrations adds the letter S in the table name
I have a model: public class pimentel { [Key] public int id { get; set; } public string cod_item_Crm { get; set; } public string tag { get; set; } public string data_anal { get; set; } public string…
-
1
votes1
answer73
viewsTransform a byte array into Dataset
I am reading an excel file (xls, xlsx, csv) and displaying its contents on a new page using Dataset. I can do for xls and xlsx, but for csv it’s not rolling. public static DataSet result; public…
-
1
votes2
answers135
viewsWhy only an Encoding works in the algorithm?
Here’s the deal: I have an encryption module that encrypts a byte[] and out another byte[] encrypted, and at the end of the output a checksum is placed; the checksum is a single byte generated by…
-
1
votes0
answers28
viewsReturn Datalayer value
Good afternoon. I have a precedent that makes some commands and returns 0 = success; 1 = without success; alter PROCEDURE [dbo].TesteRetorno ( @DS_NOME_ARQUIVO_SINCRONISMO AS VARCHAR(200) = null )…
-
1
votes2
answers49
viewsJson with C# with node numbered
Does anyone know how to read objects with this file template? It seems that the creator did not use [] for Arrays and also the second node is numbered (not key : value like the json basic). { "1":{…
-
1
votes2
answers4211
viewsPassing parameter through URL
how do you pass a parameter to another VIEW screen, without the user seeing it in the URL? For example : I have a query screen that the user clicks on the table and is redirected to another screen,…
-
1
votes2
answers86
viewsIs there a sure way not to wait for a lawsuit?
There is a safe way not to wait for a process on . NET? async Task DoFoo() { // ... GravarLog(); // ... } void GravarLog() { // ... } In the above code, my entire process will wait for the method to…
-
1
votes1
answer71
viewsI’m not able to add a reference to my program
I need to use this structure. The problem is that I’m unable to find it in the . NET Framework. I’ve already added a reference to System.Numerics and put the using, but I still can’t use it. I also…
-
1
votes1
answer158
viewsArea Routes in ASP.NET MVC?
I’m working with areas but it’s not working the route and I created 2 areas, inside a created a folder called Cadastros and inside the other a folder called Tabelas. Cadastrosarearegistration.Cs…
-
1
votes2
answers706
viewsMultiple error Object sets per type are not supported
I have a bug in my application. I am working with Identity for user authentication however when calling Controller created is returned me the following error: Multiple Object sets per type are not…
-
1
votes1
answer417
viewsHow to pass a list of integers as Dapper parameters?
I am trying to pass a parameter which is a list of integers, this should be attached to query in the sql server IN clause, but I’m not sure how to use it with DAPPER. I tried to do it this way. var…
-
1
votes1
answer771
viewsXML Serialization, how to do
I need to generate XML in the TISS standard of the ANS. I got the schemas available on website, and by xsd2Code generated tissV3_03_02 classes. I installed an object of the type ctm_guiaLote and now…
-
1
votes1
answer128
viewsIs it possible to "debug" my application inside the server?
I have an ASP.NET application in c#, and I do some debugs(obvious) in Visual Studio, but I always have a problem with directories, because the Godaddy directory for example is different from the…
-
1
votes1
answer1478
views@Html.Dropdownlistfor how to set the default value
I need to set the default value displayed by a @Html.DropDownListFor Researching found: @Html.Dropdownlistfor how to set default value So I did it in my code: @Html.DropDownListFor(model =>…
-
1
votes1
answer294
viewsImplementing the concept of inheritance in a database
Why the attribute PessoaJuridicaId is not generated? This is the base class Pessoa: public class Pessoa { public Pessoa() { DataCadastro = DateTime.Now; } public int PessoaId { get; set; } public…
-
1
votes2
answers552
viewsWhat are the requirements for running a C# program on a client’s machine?
I’m testing my app done on c# on the customer machine, it works normally, my problem is only in printing the reports, when printing this generate this error: Ocorreu uma exceção sem tratamento no…
c#asked 7 years, 3 months ago António Mateta 159 -
1
votes1
answer252
viewsfinalize process
I am a few days with a dilemma here in my code, I am developing a routine that reads the data of a spreadsheet and populates the data in cshtml of the page, I am programming in MVC5 with Razor. the…
-
1
votes1
answer159
viewsc# delete Drawstring in picturebox
I have a pictureBox where the user with each mouse click inserts a text on top of an image in a pictureBox. It inserts several texts at various points in the image, the inserted text is taken from…
-
1
votes1
answer69
viewsC# - Outofmemoryexception when searching for thousands of Active Directory groups
I’m searching thousands of groups with hundreds of users each of Active Directory, but it’s consuming a lot of memory. It starts with about 300 MB and when it reaches about 1800 MB, seen in the task…
-
1
votes2
answers78
viewsC# error in dymamico click event
By clicking on the dynamico button of the event click Tiles , it opens several sites loaded from the file Settings.ini ... in case it should open one by one relative to the name and link but open…
-
1
votes2
answers110
viewsVisual Studio C# 2015 does not debug
Here’s what I’m trying to do: I compile the program by clicking start; The screen splash is displayed, the progress bar rotates and reaches 100% (closes the screen splash); Opens the screen of…
c#asked 7 years, 3 months ago Fabio Aragão 135 -
1
votes2
answers263
viewsHow to select the whole object, Lambda C#
I have a difficulty here in this lambda, I would like to know how I select the whole object without having to specify all its properties. Like a: SELECT * FROM Somethings Without having to specify…
-
1
votes0
answers27
viewsProblem in Webbrowser’s Asset
Hello, I’m having trouble in an Asset I recently acquired, where it accuses a problem called Sharedpluginserve.exe, it is an Asset that allows browsing the internet through Unity, the problem occurs…
-
1
votes1
answer85
viewsError making an Insert in sql server with c#
I am trying to make an Insert in a table and am getting an error message. Error image: Code: private void etqmanual() { conex.Open(); SqlCommand comando; StringBuilder Query = new StringBuilder();…
-
1
votes1
answer261
viewsMahapps and WPF - How to apply "enhance" effect when I pass the Mouse over a Tile
I’m wearing a Framework called Mahapps in my project WPF and would like to apply a highlighting effect on Tile, when I passed the mouse over it. Someone knows how to do? <Page…
-
1
votes2
answers88
viewsEmail Differentiating two environments in the system
Personal I need a help, in my system I have two Environments, one of production and the other of homologation. So in my system, I have a part that sends email, to the user. Could someone help me so…
-
1
votes1
answer171
viewsFill a Datagrid with data from a list but stating which columns I want to display
Dear colleagues. I want to fill a Datagrid from a list. The detail is that I want to select the columns to be displayed. If you do not inhibit auto generation of the columns, the data will normally…
-
1
votes1
answer614
viewsError while sending Nfe
I’m trying to send Nfe using the SEFAZ RS webservice, but this generating some errors when I call the method nfeAutorizacaoLote. It seems that the error is in the configuration of the webservice.…
-
1
votes2
answers446
viewsHow to check for async processes running
Does anyone know any way, to check if any process Async is being executed? For example, I would like to do a check, when the user closes the system, and not let close all processes Async be…
-
1
votes2
answers80
viewsMethod is executed by clicking the button despite doing "button01.Enabled = false"
I want to disable a button while the method does not finish. I used button01.Enabled = false;, but even clicking while the button is disabled, the method is called again after it ends. For example,…
-
1
votes1
answer144
viewsHow to create a track extending an Image in c#
I am developing a method to add a purple stripe to the images that are processed in my application. I’m using c# to draw in the image, currently I do so: using (Image image =…
c#asked 7 years, 3 months ago Leonardo Bonetti 5,313 -
1
votes2
answers219
viewsLoop memory and processing optimization
The code is simple and is working perfectly, but wanted tips on how to optimize it, what would be the best methods to use to allocate less memory, best practices, etc. using System; using…
-
1
votes1
answer6295
viewsHow to use line break in c#
I have a tag and on that tag I have a field that is very large. I need to break the line, to go to the bottom line when I reach a certain number of characters. etqfracpic1.Add("Cas: " +…
c#asked 7 years, 3 months ago Junior Guerreiro 617 -
1
votes1
answer33
viewsHow to make Telerik Radhtmlchart responsive?
I have 3 graphics RadHtmlChart of Telerik on a page, I’m dividing this page into 3 so that they are always displayed, without the need to roll a scroll to view them. I need that when resizing the…
-
1
votes1
answer121
viewsCapture Tracesql query in LINQ c#
I have an appointment in LINQ and I need to capture the generated sql, but I did not succeed. The conversion to Objectquery that I found does not work. What is missing? var sqlConsulta = (from a in…
-
1
votes1
answer52
viewsHow do I fill in a combo I fill in her Value with wpf and c#
I made this code to fill out a combobox. It works perfectly, but I need besides the text to be presented in the combo, also need to load a kind of Value, as we do on the web where we have Name and…
-
1
votes0
answers24
viewsObjectcache - Removing all content after a few refreshes
I’ve been working with the ObjectCache for some time and I have had some problems with users who disconnected after some time of use. What’s going on that the ObjectCache is removing Cache after a…
c#asked 7 years, 3 months ago BetaSystems - Rodrigo Duarte 666 -
1
votes1
answer129
viewsHow to handle a rendering Exception in WPF (Windows Presentation Framework)
Randomly my system causes this Exception (which I only see because of the logs left in Windows events). It’s an app that runs around 24 hours a day every day. When error occurs, the screen freezes…
-
1
votes3
answers648
viewsRemoving items from a Combobox
I have a ComboBox Status searching approximately 13 status of a table: cboStatus.DisplayMember = "nome"; cboStatus.ValueMember = "codigo"; cboStatus.DataSource = CartoesVTBLL.Status();…
-
1
votes1
answer26
viewsConversion error when trying to insert into the bank with Entity and c#
This is the method to insert: public virtual void Inserir(T item) { contexto.Set<T>().Add(item); contexto.SaveChanges(); } I created a method by passing the parameters to my object and then…