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
answer82
viewsDownload View instead of displaying it
there is some way that instead of me returning a view and displaying it on the screen for the user, I return it but instead of displaying it I save the file . html on the computer? The code is as…
-
1
votes1
answer414
viewsForm validation ASP.net mvc!
I have a form that validates the fields when trying to send information, only I have a "novapagina" option where I would not like to validate the fields, this would be possible? In the views <div…
-
1
votes1
answer80
viewsCreate controls dynamically in WPF
I need to create checklists that depend on previous inputs and processing. How do I create these "checklists" dynamically in WPF? (a code snippet, please).
-
1
votes1
answer358
viewsDisable event scheduling by fullcalendar
I have a program and have to schedule events by month and by week, I am using the jQuery fullcalendar, I would like to disable the scheduling of events by month. And schedule just for the week.…
-
1
votes1
answer57
viewsC# add controls to my form
How do I dynamically add the controls to my form? During the program depending on what happens I would like to add controls(button,textbox) to my program.
c#asked 7 years, 6 months ago user68615 -
1
votes0
answers193
viewsComexeception was unhandled
When initializing the class SpeechRecognition, it appears that error and not following my application: {"Failure in factory recovery of COM classes of component with CLSID…
-
1
votes2
answers1318
viewsMake one method wait for the end of the other
Good morning, you guys, I am with the following doubt, when clicking a button my program makes to execute 2 methods simultaneously, method of sending email, and method of generating the pdf, it…
-
1
votes1
answer39
viewsWhy do navigation properties need to be declared virtual?
I’m mapping a relationship 1 x N using a class POCO (Plain Old CLR Object) to be used with the Entity Framework 6. In this case, I own an entity Cart which has several Products: public class…
-
1
votes1
answer108
viewsTake CSS link with Regex
Good morning guys, when pulling the html of the entire page in string it also brings some reference links: <link href="~/Content/item/item.min.css" rel="stylesheet" /> I already removed the…
-
1
votes1
answer19
viewsDB table not accessible
I have an associative class (Fluxousuario) between User and Flow, where Fluxousuario contains permissions of users for Flow, to know who can access a certain flow, I must go to this associative.…
-
1
votes1
answer48
viewsCheck Text Box character to mark on a radiobutton
I would like to know how to check whether the letter filled in a textBox is A or B as the result Checked in a RadioButton.
-
1
votes1
answer148
viewsEncryption of a C#class
I have the following code in PHP: $params = json_decode(trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $api_secret, base64_decode($enc_request), MCRYPT_MODE_ECB))); Where the result is an array and not a…
-
1
votes1
answer32
viewswhat is the clientcontext Sharepoint object?
I’m having a doubt, I’ve researched some places but I can’t understand what context is that the clientcontext instance class. I am using in my code passing a URL (obviously) I know this class…
-
1
votes1
answer621
viewsHow to compare the structure of two tables and update the other?
The question is the same as the title: How to compare the structure of two tables and update the other? I have an online database, which I intend to update its structure. I also have some customers…
-
1
votes1
answer57
viewsHow to foreach in each select using EF6?
Follows the code: var list = new List<String>(); list.Add("Casa"); list.Add("Apartamento"); var connection = ctx.Table.Where(x => x.Tipo== list).ToList(); My database:…
-
1
votes1
answer284
viewsIn this case use switch or if?
I have an exercise to do which consists of the following: The user informs the salary, and depending on the amount informed, he earns an increase according to the table. Example: From 1000 to 1500…
-
1
votes2
answers2427
viewsExclude element from an array
Need to delete the first element of an array. Have: Numero[10]. How do I delete the value in Numero[0] and overwrite the other elements?
-
1
votes1
answer92
viewsInsert to the C#Dynamic Database?
I’m making a insert and use a model with the Getters and Setters, when I do the insert in the values I receive to model as a parameter and use as follows sql = "INSERT INTO " + Table + "(" + campos…
-
1
votes1
answer121
viewsAdditional information: The input character string was not in a correct format
What’s wrong with my code? conexao.conectarBD(); conectar.Open(); comando.CommandType = CommandType.StoredProcedure; comando = new SqlCommand("INSERIR_CLIENTE", conectar);…
c#asked 7 years, 6 months ago Wellington Andrade 11 -
1
votes1
answer83
viewsException in Split()
I have in my system an index of terms, know which word is being used most among the messages of the users, for this, I created a class Termos and I made a loop to generate a new object for each…
-
1
votes1
answer83
viewsChange Aero application color
How to change the application color . NET/Forms in the Windows Aero taskbar?…
-
1
votes1
answer125
viewsRelationship 1:N with RU
I have a table of units as below: public class Unity { public int Id {get;set } public string Name{ get; set; } } public class UsersRight { public int Id {get;set } public string Name{ get; set; }…
-
1
votes2
answers702
viewsDecimal value conversion error in Insert C#
I have an Insert that receives some parameters, more at the moment that mount the sql statement this giving conversion error: Error Converting data type varchar to Numeric.…
-
1
votes0
answers117
viewsServer Socket in Windows Azure, how to capture External Ip?
I developed an App Console, which creates an asynchronous Server Socket. A similar can be seen HERE. I also have a common Web App, which consumes the information entered in the database by the App…
-
1
votes1
answer62
viewsList names in a query and send to a Viewmodel
I wanted to list the names belonging to a group and send to a Viewmodel and be collected by a View(details). Problem: 'Iqueryable' does not contain a Definition for 'Catechetizing' and in the…
-
1
votes0
answers86
viewsSame script on various gameobjects
I have four gameobjects on the screen (active) each with the same script, but renamed to not look exactly the same. My problem is that when I call via touch one of them the other is who obeys the…
-
1
votes1
answer803
viewsChange path linked table ms access
I have 2 database that to be used in an application copy them from the server on the user’s local machine. Between these two banks I have a linked table, I need that when I copy to the local…
-
1
votes1
answer402
viewsWhen choosing a company connect to the Database
Aguem could help me I’m doing a project to deliver this year in college in 4 layers I have a login screen and when I type user and password I choose the company I should work example Company A,…
-
1
votes2
answers1761
viewsASP.NET MVC - How to Change Textboxfor’s "Name" Attribute
You can change the name of the field generated by @Html.TextBoxFor ? I found nothing in Portuguese related to this. I tried something like: @Html.TextBoxFor(x => x.ToDate, new { name = "to" }) If…
-
1
votes1
answer35
viewsParameter’s passage
I have the following code that dates the Mysql database to textblock: textBlock8.Text = (reader.GetString("Data")); What happens is that it is passing the date and time. I would like to pass only…
-
1
votes1
answer131
viewsUnity and Unitofwork
Salve galera, I created a small project to apply Ioc using the Unity MS. First I always used the concept of Unitofwork just instantiated it into my controllers, But now I want to inject them. When I…
-
1
votes0
answers34
viewsWhat is string interpolation?
Good night! I’m learning c#, and my teacher talked about string interpolation, only I don’t understand what that is. Could you explain to me?
-
1
votes1
answer184
viewsEvent item Combobox
I have a combobox and would like when I selected the date item to make the datapick visible. How to perform this operation?
-
1
votes1
answer329
viewsHow to mount XML with C#?
I need to build an XML like in the following example: <?xml version="1.0" encoding="utf-8"?> <MeuXML> <Clientes> <Cliente-1>Dados Cliente-1</Cliente> </Clientes>…
-
1
votes1
answer900
viewsHow to set a session timeout on the web.config
People I need a timeout for my web.config that if the user is not tinkering with the system it expires, if he is tinkering with the system does not expire time. It’s possible to have something like…
-
1
votes1
answer336
viewsTFS Automatically Merge Without Checking Conflicts
We recently installed TFS 2012 to control the versions of some local systems, but we are facing a problem. When you are asked to check in a file that has been changed, it is saved in TFS without…
-
1
votes1
answer415
viewsDoubt with return time formatted Asp.net mvc
In the application I have a query that compares the current server time with a pre-set time - saved in a table: select CAST(HORA_FECHAMENTO AS datetime) as HORA_FECHAMENTO,…
-
1
votes1
answer107
viewsHow to select in c# using data base / Sql-Server?
In a previous question, I needed to select a specific date: How to select a date in c#? Now I need to make a select that brings the records whose date is within a specific week or month. How should…
-
1
votes0
answers126
viewsConnect Sql Server Express 2014 with Visual Studio 2015
I can’t make the server name appear in Visual Studio, I have the firewall disabled and I have checked that the server is active, please help me Thank you in advance.…
-
1
votes1
answer75
viewsDifferent Windows (Xaml) for Landscape and Portrait
I’m programming in C# using Visual Studio Enterprise 2015 apps for Windows Phone 8.1. I was able to make a simple application, a calculator, but I would like to know: how do I use a shaman for the…
-
1
votes1
answer1323
viewsExtract data from a json file using Simplejson?
Json file I’m using. { "url" : "https://scontent-gru2-1.cdninstagram.com/hphotos-xaf1/t51.2885- 15/s320x320/e15/12523558_1184627644899567_723648549_n.jpg", "low_resolution" :…
-
1
votes2
answers301
viewsXmltextreader() identify end of node and duplicate tags
1 - How to identify equal tags with different nodes? ex: Categoria inside Dados and Formato 2 - How to identify who finished one product and started another? I have XML (fictitious):…
-
1
votes1
answer159
viewsHow to load an entity State-related Parents
I’m starting out in the Entity Framework and when trying to load a State entity, the related Parent entity is coming with null value, which I could adjust in my code to resolve? State class: public…
-
1
votes2
answers287
viewsCreate product classes and photos and initialize
I have a class Produto and within that class I have a class Categoria and a Class Foto. 1 Product may have only 1 category, but may have multiple Photos. The problem is with the photos. I did so:…
-
1
votes0
answers586
viewsVisual Studio 2013 Debugger does not work with external DLL
I have an application that was migrated from VS2008 to 2013, . Net Framework 4 and C#, using a DLL from another project. Build no errors. However after execution, at the time of instantiating the…
-
1
votes1
answer72
viewsShow string in excel without single quote
I have a routine that generates an excel. It has a field in BD(Oracle) that is varchar. This means that in the database it is formatted with zeros on the left. Well, what happens is that when it is…
-
1
votes0
answers194
viewsArgumentexcept Unity5 Input error horizontal is not setup
I’m trying to follow the game tutorial "Nightmare" canal playing with Nils, my script does not present any errors, however my character does not move and the Unity 5 shows this error related to Axis…
-
1
votes1
answer144
viewsI made my first program and now I need to run it on the client. How do I?
I made my first program and now I need to run it on the client. How do I? I made my database with SQL Server Express 2016. My windows is 64 bits. I thought of installing the same bank in the client,…
-
1
votes1
answer469
viewsEntity Framework 6, many X many relationship and Scaffolding
I am conducting a college project and my knowledge in ASP.Net are not very deep. In my project I came across a relationship Mxm and I cannot usefully implement this situation. The relationship is as…
-
1
votes1
answer344
viewsHow to choose the first form to be displayed?
When I run my project, fmPrincipal is always open, however, I decided to create a fmLogin to be displayed first and the user login to it. How do I set up fmLogin to be displayed first?