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
-
3
votes1
answer851
viewsHow to check if a file is corrupted in c#?
How to check if a file is corrupted in c#? Ex: I have a "xpto.txt" file in a directory and need to check that this file is not corrupted.
-
3
votes3
answers1452
viewsCopy value between quotation marks C#
I have a Textbox that is fetching the text from another form, and now I intend to copy a value that is in that Textbox. Attached image with what I want:…
-
3
votes1
answer305
viewsHow to configure which folder the software should be installed/updated in?
I followed suit of that question where it is explained how to configure my software to be updated automatically. I would like to know how to change which folder this installation/ update should…
-
3
votes1
answer58
viewsI have a local BD in c# sql. When I went to install the client gave the following error
Someone could help me? I installed my project in the client with local database, I took the bd along and such , but gave this error:…
c#asked 9 years, 4 months ago Rennan Hanna 107 -
3
votes2
answers703
viewsError reading html page with Html Agility Pack
I’m reading an HTML page using Html Agility Pack. I run the code on my laptop and it works perfectly. The problem is when I run it on Windows Phone 7.1. Accented characters (ç) are encoded. And the…
-
3
votes1
answer164
viewsWhere to make the connection to the database?
In the MVVM pattern where I must connect to the database, in View, Model or Viewmodel?
-
3
votes0
answers83
viewsQuestions about Forms Authentication ASP.NET
I have an ASP.NET project and need to enter a user control to limit access to the pages. There is already a table in my bank with Login and Password, I found some tutorials that explain how to use…
-
3
votes1
answer67
viewsRemove namespace or full names
My question is if there is any shortcut, command or Visual Studio function that removes namespace or full class names, for example: for you to add a Data Annotation without doing a using vc you have…
-
3
votes1
answer433
viewsHow to use a theme in wpf?
I’m trying to use a package of WPF themes, but I can’t call it, when I use it says it lacks the reference and I can’t find any tutorial or anything current about it. I tried to install using nuget…
-
3
votes1
answer662
viewsChange application title in Xamarin Android
I can’t get this off string $projectname$ of my title in an application on Xamarin Android. I already tried to edit the AndroidManifest.xml and AssemblyInfo.cs and nothing. I looked for this string…
-
3
votes0
answers316
viewsConnection problem with bank . mdf
I’m in the way of connecting my application C# (Windows Forms) with a database in .MDF, which is already inserted in the project folder. On the computer of the course worked normally, but at home I…
-
3
votes1
answer92
viewsHow to exchange terms in an Expression?
Based on the following reply in: How to Convert an Expression Tree to a partial SQL query?, I’m using a class inherited from ExpressionVisitor to try to treat some conditions in my expressions.…
-
3
votes1
answer100
viewsGoogle Api - SEO - Google Index and Google plus via json
I need to recover via json or some other way Google SEO information to feed my database.. For now it’s just Google Index and Google+ Does anyone know how to do that? Or someone has some example of…
-
3
votes2
answers83
viewsdoubts about localDB in MVC C#
I made a post here about where the application stores template information Register that comes in MVC applications when we create a new project. Well, the question would be as follows: If I wanted…
-
3
votes1
answer3145
viewsHow to take duplicate values from an Arraylist
I would like to know how I can separate the double values, an example: I have a Variable FormaPagto defined as a ArrayList, In this variable I have 6 data: 0 - Money 1 - Debit 2 - Debit 3 - Money 4…
-
3
votes1
answer677
viewsProblem storing decimal values in SQL Server
I have a decimal field (18, 3) and in the application I use a Javascript plugin to format the entered values, so I pass the value so SQL Server 45.000.000.000, when I look at what was registered was…
-
3
votes1
answer625
viewsSerialization of lists in C#classes
Good afternoon guys, I’m running an Nfe project for emission, so I opted, after searching use class serialization to mount xml. Everything works very well, from a class structure that defined the…
-
3
votes2
answers79
viewsAdd CSS to the Grid Record
I’m trying to add a bold in a record on the grid, but it appears as "<b>Nome</b>" and not "Name" as it should. I’m doing it for code behind, through a LINQ Follow my method…
-
3
votes4
answers5376
viewsSELECT within the UPDATE
I have the following database: cd_telefone|cd_cliente |nr_ddd |nr_telefone 1 | 30 | 11 |2562-2791 2 | 30 | 11 |2562-2791 3 | 31 | 13 |8888-8888 4 | 30 | 11 |5555-5555 5 | 30 | 13 |9623-54002 6 | 30…
-
3
votes4
answers164
viewsFather class with the same responsibility of the daughter class
I got my class Item public class Item { public string Nome {get;set;} public decimal Valor {get;set;} public ICollection<SubItem> SubItens {get;set;} } public class SubItem { public string…
-
3
votes2
answers917
viewsPrint word file by c#
Hello guys I am trying to print a word.doc file, I am using the following code. using Microsoft.Office.Interop.Word; Microsoft.Office.Interop.Word.Application application = new…
-
3
votes1
answer282
viewsRelationship between different contextual classes Entity Framework
I have a problem saving an object, due to it having relationship in a different context, I wonder if there is a way to solve this problem.
-
3
votes1
answer257
viewsInheritance with Repository Pattern
I’m studying and trying to implement the Repository Pattern in C# however I am having some difficulties in solving certain problems with inheritance among my classes of Repository, for example the…
c# oop entity-framework pattern-design inheritanceasked 9 years, 10 months ago Pablo Tondolo de Vargas 5,444 -
3
votes1
answer49
viewsHow to create a Helper for creating Datepicker
I would like to create an MVC Helper for the creation of a Datepicker. Example: @Html.DatePicker();
-
3
votes1
answer66
viewsTransfer value from C# to jQuery
Well, I have a job in ASP.NET here where I can upload music to a folder on the computer and already have a function on C# to search the address of the archive. Anyway, I wanted to use this path in a…
-
3
votes3
answers3527
viewsSwap characters inside a string, in a string
Simple question: I just want to replace the characters A inside the field " " and not what is out for a B, example: aaaaaaaaaa"aaaa"aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa…
-
3
votes1
answer781
viewsUsing the Signalr
Well I’m starting to venture into Signalr. I decided to follow this Tutorial. Good after doing all the steps, when executing the project presents me the following error: Unhandled Exception at line…
-
3
votes2
answers917
views -
3
votes1
answer21
viewsFolderdialog in Consoleapplication C#
I am with a question related to Console Application, as I do to open a window similar to this where it is possible to select a FOLDER? It would be a resource like the one in Windowsforms where it is…
-
3
votes2
answers2084
viewsWrite input button in ASP.NET c#
I have the following code: r.Write("<th colspan='3' style='text-align:center'><input id='btEmail_" + (n - 1) + "' name='btEmail_" + (n - 1) + "' runat='server' class='btn bg-brownCinc'…
-
3
votes2
answers593
viewsHow to pass filenames to a Datagridview using Folderbrowserdialog?
How do I pass the name of the files that were found inside the selected folder? So far I’ve only managed to get him to pick up the file’s path and move on to the DataGridView and now I want to make…
-
3
votes1
answer933
viewsSynchronize Threads
I have a 3-thread application, this application involves a chemical process simulator, and I have to take some values of these processes. values come in a single object. The 3 threads make an…
-
3
votes1
answer533
viewsxml load in gridview
In my project, I need to select an XML file from some hard drive folder and then read its contents and show in a gridview. Right now, I can open the window to select the file, but I can’t read that…
-
3
votes1
answer412
viewsDragdrop for files . txt Windows Forms
I wonder if it is possible to use Drag and Drop in Windows Forms for files outside the application, in this case, a . txt(As is possible in WPF). I only found examples using Listbox. If possible,…
-
3
votes1
answer170
viewsQuestions in Windows Forms and C#
I’m trying to learn C# but I have a hard time understanding the hierarchy of files and folders of Solution Explorer from Visual Studio 2013. I can’t understand why there are two files .Cs, which is…
-
3
votes1
answer2933
viewsSending a message to a local network broadcast via UDP
I made a question about P2P connection, then with one of the answers the question arose: How to send a message on a local network via UDP in style broadcast, without a specific recipient? With this…
-
3
votes1
answer1053
viewsChange file extension into C#
With Openfiledialog I am opening a file, and I want Load to change the extension. That is, I’ll put that the "openFileDialog1.Filter" would only be for ". txt" and I want it to change to ". cnf".…
-
3
votes2
answers745
viewsHow to concatenate Strings into a Linq query
How do I concatenate the column Sistemas, leaving Sistema, Sistemas 2? I have this appointment Linq: var fiscalizacoesBaixadas = (from tb_fiscalizacoes_campo in _context.TB_FISCALIZACOES_CAMPO join…
-
3
votes2
answers606
viewsNumber of lines per page reporter Viewer c#
I would like to know how to display in the report (reporter Viewer/c#) the number of lines per page and the total amount on all pages of the report.
-
3
votes3
answers1833
viewsDelete Relate Record using Entity Framework
Good morning. I am working with Entity Framework and I have a problem updating a relational table. For example, I have a product with several categories, in the edition I remove the category x of…
-
3
votes1
answer1033
viewsUse Onblur in Asp.Net with problems!
I need to format and validate a data field using the property OnBlur of Javascript within the codebehind C#. The problem is that it executes the javascript function and does not return the value to…
-
3
votes1
answer114
viewsList of forms in the project
I need a List<> of all the Forms in project c#, to start the exe enter in the database the name of all Forms.
-
3
votes1
answer426
viewsHow to improve the performance of a foreach
I’m consuming a webservice, that has at least 5557 records. The problem is after consuming. I have to add in my database the records, and for that, I have to do a foreach, what ends up disturbing a…
-
3
votes1
answer3281
viewsTextbox and dynamic C# + ASP.NET button
I am feeding a webform with textboxes and buttons from a Repeater, according to the tuples(table people) returned in an SQL query, linking the code to specific attributes within these controls. For…
-
3
votes1
answer444
viewsGet the pressed key with minimized application or without focus c#
I would like to press the Printscreen on the keyboard, the C# application that is minimized in the Tray system, be maximized and display the image of the print.
-
3
votes1
answer1734
viewsHow to return dynamic list?
How to return a List<dynamic> in ASP.NET MVC 5 and Entityframework 6 For example I have an object with name User and mapped in my EDMX, when I do to bring the data dynamically like make an…
-
3
votes2
answers1266
viewsRegex time greater than 00:00
I’m developing a regex validation using the System.ComponentModel.DataAnnotations and RegularExpression from Asp.net mvc C#, in this regex it is necessary to validate unlimited duration time in…
-
3
votes2
answers1498
viewsEntityframework, Migrations and Mysql. Schema name being misinterpreted. How to resolve?
I have a problem using Migrations with Mysql. When I try to create the first version with Migrations he’s making the schema/name of the bank part of the table name: public partial class Initial :…
-
3
votes1
answer311
viewsFixed Menu in Csharp
I would like to know how to have a fixed menu in c#, as the user moves the application, just change the context, similar to web pages.
-
3
votes3
answers2456
viewsPhone and CPF fields in SQL?
I’m wondering what type of variable to create for the CPF and Phone fields in the database, they should be saved like this: (34) 9652-5214 134.124.214-47 With nchar wouldn’t complicate the search?…