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
-
2
votes1
answer94
viewsHow to detect Network Instability with C#
I have a Winforms system where the folders that this system generates and uses stay on a server, but there are some routines of this system that keep creating several PDF’s on the server, and when…
-
2
votes2
answers421
viewsJavascript variable value assignment
I have the JS code below and the return of JSON does not assign the value to variable texto. I did a test with alert(data.frase) and the message came normally. Would anyone know why to go texto does…
-
2
votes1
answer1170
views"arithmetic Exception, Numeric overflow, or string truncation string right truncation" in search using LINQ
I have a table in a Firebird database CREATE TABLE CIDADE ( CID_CD SMALLINT NOT NULL, CID_DS CHAR(20) NOT NULL, CID_UF CHAR(2) NOT NULL, CID_DISTANCIA_SEDE SMALLINT NOT NULL, CID_CD_ALTERNATIVO…
-
2
votes2
answers2325
viewsError 500 when consuming Nfedistribuicaodfe
I’m trying to consume the NFE download service on the farm: https://www1.nfe.fazenda.gov.br/NFeDistribuicaoDFe/NFeDistribuicaoDFe.asmx Specification…
-
2
votes2
answers555
viewsInternationalization in DDD (Domain Driven Design) architecture
What would be the best strategy to internationalize a system in the DDD architecture, knowing that we have strings to internationalize present in the layers: Presentation - Views Application -…
-
2
votes1
answer312
viewsReceive Token through Webrequest?
Guys is there any way I can generate a token through a Webrequest? Because every time I use the Google Drive function I need to open the authentication page only to generate the Access Token, there…
-
2
votes3
answers842
viewsCheck two or more occurrences of a listed element (lambda/Linq)
I have the following list<t> listCard; within it I have the following values: [0]:7720890002560 [1]:7720890002560 [2]:7777777002560 [3]:7720890002560 [4]:7720444402560 [5]:7720777002560…
-
2
votes1
answer148
viewsDevelopment without EF ORM
It is valid the development without ORM, because today I want to develop an ERP, but I have no knowledge in any framework, is it valid I do everything in hand? I will have the same result? Because I…
-
2
votes0
answers712
viewsASP.NET MVC - Alternative to the DDD
I will start building an application let’s say, initially small, about 5 Cruds and only 1 Core (this yes a little more complex in terms of business), but the goal is that it grows over time, using .…
c# asp.net-mvc entity-framework pattern-design software-architectureasked 8 years, 9 months ago Guilherme Ferreira 369 -
2
votes1
answer91
viewsarterySignalIr/Ping - What is causing this error?
The project MVC in C# here the company is with a very bizarre bug, to say the least. From time to time a random error bursts: The controller for path ...arterySignalIr/Ping was not found or does not…
-
2
votes2
answers1705
viewsWhy does unreachable code Detected error occur in C#?
public Boolean LogarUsuario(string Pnome, string Psenha) { using (OleDbConnection conexao = new OleDbConnection(Conexao.stringConn)) { conexao.Open(); cmd.CommandText =…
-
2
votes2
answers557
viewsAdd hyperlink to Messagebox c#
It is possible to customize the MessageBox.Show("http://www.google.com/"); so that this link is a hyperlink and when I click open a browser? The only possibility really would be to create a new…
-
2
votes0
answers479
viewsFormat excel cells via Behind code
I have a routine that generates a spreadsheet in excel, coming from an Oracle database. What happens is that in BD I have values like this: 3456.90 or 1900.00 When these values arrive in the…
-
2
votes1
answer265
viewsExit Standard Event on ESC key
Currently in my system I use the event KeyPress to identify the key Esc and so close my form, but I have a very large system with more than 50 forms and even more being developed: My question is: Is…
-
2
votes1
answer180
viewsDoes Tempdata lose property when using Response.Redirect?
I have the following code on the pages that, to be accessed, it is necessary to log in: if (Session["Login"] == null) { TempData["msg"] = "É necessário realizar o login para acessar esta página!";…
-
2
votes2
answers212
viewsAssign Tuple return in two variables
Has a method that returns a tuple with two strings. The return I want to record in two different variables, only I’m having to call the method twice to pick one item at a time. string retorno1 =…
-
2
votes1
answer248
viewsASP.NET vs Intraweb
Since I come from PHP and I’m starting now with ASP.NET and I’m pretty raw, I’ll need to argue about. NET to one of the owners of the company, and he develops in Intraweb. By my vision of WEB, the…
-
2
votes3
answers1401
viewsHow to access object created by another thread?
It is possible to access an object created by another thread?
-
2
votes1
answer73
viewsSelect(HTML) with multiple selection. Mark one and should mark all, not working
I have this select with multiples select <tr> <td width="10%" class="label_right">Autorização Prévia: </td> <td class="label_left"> <select…
-
2
votes2
answers427
viewsHow can I detect if the value of a textbox has letters?
How it is possible to validate in a TextBox when the user type letters instead of numbers appear a warning: is only allowed to enter numbers in this field What function can I check with?…
c#asked 7 years, 5 months ago Gabriel Longatti 559 -
2
votes1
answer191
viewsSaving a binary xls to SQL Server
I have an xls file that I upload and transform into binary as follows: FileStream fs = new FileStream(physicalPath + "/cadastros/documentos/" + "AWS-Estudantes_" +…
-
2
votes1
answer738
viewsCreate ODBC Connection
I am performing the integration of my system with the SEFIP. The database is in Interbase (.gbd). I can connect to the database via Microsoft Access normally. I created an ODBC connection manually…
-
2
votes1
answer1104
viewsTake and display data from a class attribute (class association)
I’m having a little trouble picking up a value from an attribute of the type class. Classe Pessoa public class Pessoa { public string Nome {get;set;} public int Idade {get;set;} public virtual void…
-
2
votes1
answer123
viewsAjax - Protect Webservices
I am building an Asp.net MVC application and make many calls to actions and webservices via ajax (jquery or Angularjs). How could I hide these calls, or ensure they are made only by my app? For…
-
2
votes1
answer1676
viewsCannot Convert from 'string' to 'System.Iformatprovider'
Follow the code (works): var teste = 1; var teste1 = teste.ToString("000000"); Upshot: 000001 Follow another code (does not work): var teste = "1"; var teste1 = teste.ToString("000000"); Upshot:…
-
2
votes1
answer4347
viewsManipulate page with Webbrowser
I’m having trouble sending values to a form via Web Browser. My goal is to make a post, IE, send the values to inputsof the form and do the submit from the same, after this open the page generated…
-
2
votes1
answer147
viewsMake calculation using LINQ
I am developing a program in c#. In it I have three tables: produto { string idProduto; string descricao; } entrada { string idProduto; int quant; } saida { string idProduto; int quant; } and I want…
-
2
votes2
answers431
viewsWeb system accessed by various companies appsettings
I am developing an application in ASP.NET Core, in which each company has its own database. The question is: how can I do for the company To access the site by putting user and password and access…
-
2
votes1
answer196
viewsObjectdisposedexception
I have the following code snippet: var nivel = 1; List<meuObjeto> meusObjetos = new List<meuObjeto>(); using(var objectContext = ((IObjectContextAdapter)db).ObjectContext) { var cmd =…
-
2
votes1
answer39
viewsHow to call another action and return the value?
Follows code: public ActionResult Teste1(int num1, int num2) { var valor = Teste2(1, 2); //Aqui recebe valor nulo } public ActionResult Teste2(int num11, int num22) { //Alguns valores aqui... var…
-
2
votes1
answer231
viewsDesign standard to combine data from different databases
I’m taking data from two different databases and need to format this data for Json. The problem is not accessing the two banks and getting the information. The problem is that my class became more…
-
2
votes3
answers106
viewsMore attributes in Appsettings
You can add other values to AppSettings without breaking with the application? Standard values: <appSettings> <add key="Nome" value="ValorTeste" /> </appSettings> I’d like to leave…
-
2
votes1
answer277
viewsDevice keyboard is over Input
I have an application in Xamarin using Hybriwebview (HTML screens). Inside it I have a text input at the bottom of the screen and when I click on the input the keyboard of the phone is over my…
-
2
votes0
answers84
viewsBindingnavigator c#
Good afternoon! I’m using the C# bindingNavigator to register data to the database, but I don’t like how the process is done with the buttons up there and having to click on that yellow button too…
c#asked 8 years, 8 months ago Gustavo Oliveira 21 -
2
votes1
answer752
viewsPrinting with Reportviewer Asp.Net
Good afternoon, I’d like some help. I am generating an impression by Reportviewer with Visual Studio 2010, the report is generated correctly but the print view does not show the Print button in the…
-
2
votes2
answers84
viewsError running Savechanges EF6
Before it was working normally. Now I face this problem when running this code: try { db.SaveChanges(); } catch (Exception ex) { //erro aqui } Error message: Exception: Spatial types and functions…
-
2
votes2
answers316
viewsRefresh Listview c#
Good morning. I have a Form1 with several methods. In one of the methods I create another form2. In Form1, I have a listview with Database values. In form2 I will insert new values. I would like to…
-
2
votes1
answer298
viewsError trying to insert Datetime.Minvalue into database
I have an object that has a property Datetime and, start with the value of the property Datetime.Minvalue The problem is that, when passing this value to register in the SQL Server database gives an…
-
2
votes1
answer2791
viewsCLOB for string and vice versa
I’m developing a web server where I have to store images in String of Base64 exchanged for desktop, mobile and website to the database of the Oracle, but I’ve done a lot of research and seen some…
-
2
votes2
answers8291
viewscreate a file with C# content and save to a folder on the computer
I need to create a report and save this report in a folder inside the C disk: from the computer, I’m only able to save the file without the contents and with the name blank. The code to save: string…
-
2
votes1
answer1368
viewsUse of search/search filters with Entity framework
I am creating a grid with book data and I am adding some filters, the problem is time to create the filters of a table that has a link with books, I can’t navigate(Obs.:in the view I can navigate in…
-
2
votes2
answers355
viewsLambda, Where com subconsulta
I need a consult like that on the lambda SELECT ClienteId --Aqui eu tenho varios campos do Cliente e estagioprocesso FROM Cliente WHERE ((SELECT TOP (1) EP FROM estagioprocesso WHERE…
-
2
votes1
answer51
viewsAdding Radiobutton to the Datagrid in Runtime
At a certain point in the software, I need to populate a DataGrid in Runtime. I managed to perform this operation partially. My problem is that even if I insert RadioButton.Content, it simply does…
-
2
votes1
answer146
viewsGarbage Ollector is automatic?
I noticed that my application was deliberately consuming the memory even after the end of the processing, even finishing everything that was started so I called the GC.Collect(); and the memory was…
-
2
votes1
answer518
viewsModel arriving empty in controller
I basically have a Controller who sends a iList to the View, that one View could edit any record of that iList, but when the Controller receives it is already empty. I did so: Controller: public…
-
2
votes1
answer1102
viewsFluent Nhibernate - Composite Key Mapping
Greetings, I’m having a hard time and I can’t fix it. I have an application where I created the mapping and everything was working perfectly, but now I need to change it and that’s where the problem…
-
2
votes1
answer1150
viewsC# MVC - Error after Publish on VS015. 404 Not Found
I did a "Publish" by VS2015 of the Web MVC type, but in the "Publish Method" I put "File System". The problem is that I published it on IIS and run the views, but when I click on the buttons it…
-
2
votes1
answer3993
viewsWebbrowser in C# using Chrome
I have a browser application that I created using the class WebBrowser of System.Windows.Forms, this class uses the browser engine IE. Now I need to create a browser application using Chrome. What’s…
-
2
votes1
answer160
viewsAccess List<List<string>> in a Thread
I am using Winforms I can’t access a list inside a Thread. That list I’ve populated it through another method. If you leave the cursor on top I can see the items, but when I will recover through…
-
2
votes1
answer45
viewsThe interface freezes while loading an event
I did an event with a lot of time consuming operations and I need to keep describing the operations in a Richtextbox, so I use Richtextbox.Appendtext("Something"), only what I wrote only appears…