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
votes2
answers733
viewsFormat string in View
Is there any way to format a string (returned from a query) directly at View, to show the first uppercase letter and the rest lowercase? Ex: In C# I can use Textinfo.Totitlecase for that reason.…
-
2
votes2
answers1278
viewsCapture selected Dropdownlist item
I have a DropDownList with some items, and I made a click event to pick up what is selected and redirect to a page, however not working right, see: switch(ddlMenu.SelectedValue){ case "0":…
-
2
votes1
answer97
viewsQuery to SQL database in text saved by Tinymce
I am using Tinymce to edit texts on my website. When I search a word with accent. Ex.: análise, query does not find why the database is saved in HTML análise. I am using ASP.Net MVC with…
-
2
votes1
answer3519
viewsHow do I show and select one of the digital certificates on my computer
In my desktop I have some certificates and I need to select one of them, I would like to know via VN.Net or C# code how to appear a list and I choose the digital certificate I need, without having…
-
2
votes2
answers439
viewsStore modified class properties
I need to have stored in the class itself a list with (name and value) of the changed properties. However, I don’t know if the form I am using is feasible. I have the class Employee below: public…
-
2
votes1
answer2713
viewsCheck the existence of an element with Selenium
I am automating a site and in a certain part it presents a listbox that when one of its options is selected if it has available values it presents a table with these values. What I want is to make…
-
2
votes1
answer115
viewsDeployment of Sqlite together with . Net application
I finished the C# app with Sqlite, but I saw that I need to send along with the Sqlite base and DLL. Which Sqlite DLL files need to attach and which folder do I have to play these files in?…
-
2
votes0
answers27
viewsHow to send an email in RTF format using EWS?
I want to send one and mail in RTF(Rich Text Format) format using the EWS(Exchange Web Service API) ExtendedPropertyDefinition RtfCompressed = new ExtendedPropertyDefinition(0x1009,…
-
2
votes4
answers754
viewsString Array Printing in a Single Messagebox
I have a variable which is an array of strings and I want to print their values, but that values and consequently the amount of them is only set after the system works. How can I print on a…
-
2
votes3
answers461
viewsMake a cascaded Else inside a for
See below my for. Within that for there are some IF's. I don’t want another for to scroll through the same list. There is a if which validates whether IcObrigatorio == 1 and below it validates…
-
2
votes1
answer95
viewsMethod that counts the frames of a C#Augmented Reality scene
I am doing a work of Augmented Reality using Unity and Vuforia and I need to capture how many frames the scene I develop is using, I do not master much of C#, but by my research apparently Unity has…
-
2
votes1
answer36
viewsPopulating a field by selecting a dropdowlist via popup
I need to open a pop-up through the selection event of a dropdownlist in an application .net and in this way I popularized the field of the first screen with the selection of the option displayed by…
-
2
votes2
answers212
viewsIdentify file execution within a ZIP
I created an application that was made available for download within a .zip. Within the .zip has a .exe and some files needed to perform an installation. So far so good. However some users do not…
-
2
votes1
answer2765
viewsEntity Framework Left Join
Seeing the question Left Join with lambda Groupjoin and with condition, I have doubts about the way I do Left Join with Linus Having the following entities public class Cidade { public int CidadeId…
-
2
votes1
answer1587
viewsCreate a fixed header and footer for all pages
How to create a header with the logo and menu, and a footer with some information, and this header and footer are the same for all pages? No CTRL + C / CTRL + V, because if I change any items, I…
-
2
votes1
answer372
viewsHow to create connector for active Diretory?
I need to create a connector for Active Diretory, I found this example on the internet... I heard about Migrations... You know how it works? DirectoryEntry directoryEntry = new…
-
2
votes1
answer134
viewsDefault value for Datetime column
I have a table that has the field DataRegistro of the kind Datetime. I am using Entityframework to generate the database (I am not using code first) add the property Computed for the column to be…
-
2
votes1
answer279
viewsStore part of a string in a variable
I receive the string below, through a response.StreamReader: 240144|000|5511946724649|2015-08-30 21:45:51|2015-08-30 21:46:02|1| How should I proceed to store the content between the Pipes each in a…
-
2
votes1
answer1453
viewsList directories and subdirectories
I have a Treeview component, and a structure in the database that already has in the table directories the subdirectories. has a field called director_parent_guid, if it is null it is because it is…
-
2
votes1
answer97
viewsEntity Framework Extra column when using Icollection
If I have two tables in the bank, for example: tabela1 and tabela2, and in the tabela1 I have a ICollection of tabela2: public class tabela1{ public Guid tabela1Id {get;set;} //campos... public…
-
2
votes1
answer124
viewsHow to set the size of a button in centimeters?
I need to place a button with height and width in centimeters, where the size is maintained if accessed in different screen resolutions. Is that possible? If so, how?
-
2
votes1
answer99
viewsnhibernate save string in upper case (uppercase)
Hello, is there any nhibernate mapping option to save the fields string on-mode uppercase? Thank you.
-
2
votes3
answers137
viewsDoubt in research
I have a Grid, but when I type something into the field textbox, the search is not done and nothing is displayed on Grid. Follow the code made in 4 layers: Form: private void…
-
2
votes1
answer321
viewsSend UTC Datetime Javascript to C#
I have an ASP.Net MVC project as follows: In my view I have a Javascript variable that keeps a date: var hoje = new Date(); In my controller have a action which receives via AJAX the value of the…
-
2
votes2
answers3368
viewsSend email using ASP.NET MVC
How do I send email using ASP.NET MVC? Do you have an option to send without specifying SMTP similar to mail() of PHP?
-
2
votes2
answers94
viewsCatching the Location of a POST
I’m using the method HttpRequestHeader to make requests (GET and POST), but I need to take the parameter Location of the response of a POST and I am unable to evolve. There is an example of my…
-
2
votes1
answer1012
viewsGet items from a List<String> - ASP.NET
I am beginner in ASP.NET development with C# and, I have the following question: When loading a page, I run a method that fills a Dropdownlist. This Dropdownlist is part of a form and, after it is…
-
2
votes2
answers901
viewsPass more than one parameter to another page
I’m making a windows phone application, in which the main screen( first screen) is made a calculation, and the result is displayed on a second screen. I already managed to make the 'connection'…
-
2
votes2
answers675
views -
2
votes1
answer314
viewsUnity does not update frames when rotating the character with mouse movement
My Unity is not giving error, or anything. Everything is OK, but the character does not move. I’ve looked at the code and no mistakes, I move the mouse and nothing happens to the character. Unity…
-
2
votes1
answer1070
viewsSecurityexception - Permission Error
Hello, I am climbing an application in my Locaweb hosting and I got stuck in this error, someone knows how to solve this permission problem ? [SecurityException: Request for the permission of type…
-
2
votes1
answer529
viewsHow to concatenate properties of a single List<> with LINQ?
I need to concatenate two properties of each item on my list, in the example below it works but I would like to know how I can do the same thing using LINQ instead of foreach? public partial class…
-
2
votes1
answer139
viewsnhibernate with more than one database
Hello, I wonder if it is possible to use nhibernate with more than one database, some tables will be in one database and others in another. How would I do that? And in entity mappings, how would I…
-
2
votes1
answer238
viewsDependency Error
I’m using the BackgroundWorker private BackgroundWorker BGWorker = new BackgroundWorker(); BGWorker.DoWork += BGWorker_DoWork; BGWorker.RunWorkerAsync(); private void BGWorker_DoWork(object sender,…
-
2
votes1
answer1967
views -
2
votes1
answer62
viewsHow to detect if a file is in use?
I want to detect if a file started with something (javaw) in a given directory is in use or not.
c#asked 9 years ago David Amaral 81 -
2
votes2
answers197
viewsHow to import user32.dll and others into C#?
I found several and various results on the internet teaching to import a specific function from user32.dll. But I can’t get out of my head if someone hasn’t done a project with all the imports…
-
2
votes1
answer1351
viewsClose the browser only after running all tests with Selenium Webdriver c#
I am developing tests with Selenium webdriver in C#, for each test class the browser is initialized and after running all tests of this class the browser is closed. How do I initialize only once and…
-
2
votes3
answers1028
viewsFile download does not work
How to download a file via browser from a directory in my project? I tried it this way, but nothing happens: string path = "C:\\test.txt"; var file = new FileInfo(path); if (file.Exists) {…
-
2
votes1
answer1533
viewsCompiler error or code error?
I came across the following case and do not know if it is . NET error or error in my implementation, same syntax (see image below). condenacaoInsert.qtd_ano_pena = null;…
-
2
votes2
answers3063
viewsPass values from a form to a method in the Model and return the result to another textbox in the Form
I have a very simple form with 3 textbox and a button. I would like to take the value of the first two textbox by clicking the button and passing to a method present in my model and after that…
-
2
votes1
answer1208
viewsAdd textbox values when leaving the field
I have a form with three TextBoxes where the user will enter any value and a Label where I want to show the result of the sum of these values. However, I would like to add up the contents of these…
c#asked 9 years ago Floyd Diestl 19 -
2
votes1
answer13084
viewsUnity - Error: Object Reference not set to an instance of an Object - Instantiate
I made the Survival Shooter tutorial that can be found in the Unity Asset store at https://www.assetstore.unity3d.com/en/#! /content/21028 The game is working, but is giving this following error in…
-
2
votes3
answers836
viewsI can’t find an element for Id
I’m automating an operation on a website with Selenium Webdriver and in a particular region of the site when sending a wait using the WebDriverWait it exceeds the maximum time and does not find, but…
-
2
votes1
answer6140
viewsRemove X first elements from a string
I have the following code: copia = num.Text; copia = copia.Substring(cobrar.Length + 1, copia.Length); num.Text = copia; Where copia receives a string from a textbox and cobrar is a predefined…
-
2
votes2
answers1047
viewsError while running project in Visual Studio
When I run a project in Visual Studio it shows the following error: A first chance Exception of type 'System.Data.Sqlclient.Sqlexception' occurred in System.Data.dll Code using System; using…
-
2
votes1
answer337
viewsSite . NET with high performance
I will start building a website to purchase tickets and the access forecast to main page is 8000 users per minute. We must use C# . NET and MVC. The database, design standard, ORM and frameworks are…
-
2
votes1
answer1309
viewsAdd values from object list columns in Razor
I have a table, where I receive data from a View (SQL Server) and perform some operations on my page. On this page, I have a filter to show only the pages referring to the selected year. Even this…
-
2
votes2
answers10059
viewsRead or write attempt in protected memory
I have an application in C# connecting to the database Oracle. For this the application makes use of the Nhibernate (a very old version) and Castle Activerecord. This always worked, however, now…
-
2
votes1
answer320
viewsVariables with special characters
Hello, I’m trying to create a gender class: [DataContract, Serializable] public class XMLCM5050 : XmlApi { [DataMember] public string $name{ get; set; } [DataMember] public string $age{ get; set; }…