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
votes2
answers344
viewsHttppost action returning null values
I am developing a web system (intranet) to control requests in ASP.NET MVC 4 C#. Below follow my MVC where I have doubt. I am having a great difficulty with the Httppost of a Typed View, which is…
-
1
votes2
answers100
viewsExtension Methods in . NET does not work
I’m trying to create a Extension Methods for the class string. He’s not showing up. My class with the extension method: namespace MEUPROJETO.Extension { public static class StringExtension { public…
-
1
votes0
answers40
viewsDeploy Back Button in Universal Apps
Guys, I’m developing an application for Windows 10 and I have no idea how I implement a back button on a similar Pivot is in the Microsoft Weather app.…
-
1
votes1
answer102
viewsError message when generating report
I’m making a report and it’s giving an error message that I’m not finding a solution. Error: Code Generate button private void btnGerarRelatorio_Click(object sender, EventArgs e) { SqlCommand cmd =…
-
1
votes1
answer144
viewsGenerate List from Binaryformatter Deserialized Unity3d
Hello I am creating a "save" system for games and would like to know how I can generate a list from an object BinaryFormatter? this file is formed from 3 information, and would like to generate a…
-
1
votes1
answer337
viewswkHtmlToPdf - Header and footer on all pages
I’m trying to generate a "report" using Rotary, but I’m having difficulty to repeat the header and footer on all pages: This is the outline of what I’ve done: Controller using System; using…
-
1
votes1
answer1990
viewsHow to disable some C#keys?
I would like to know how to disable/block some keyboard keys while the program is running or even cancel the lock? For example: If I disable/block the entire keyboard or just allow x key it would…
-
1
votes1
answer1406
viewsDisable a button on Asp.net MVC
I am developing an application that manages enrollment in courses, I am still an apprentice at Asp.net MVC, and I have the following question: On my course screen is a "registration" button for the…
-
1
votes2
answers2725
viewsError: String not recognized as valid datetime
I’m trying to convert a string q I pull from the database with the instruction DateTime PrevisaoDataInicio = DateTime.Parse(reader["PrevisaoDataInicio"].ToString()) And makes the following mistake:…
-
1
votes1
answer56
viewsHttputility.Htmldecode(), Html to Txt intention (at least), can anyone help?
I’m getting a record whose content is this below (in HTML): <p style="text-align: justify;"><span style="font-family: times new roman,times;"><span…
-
1
votes2
answers1431
viewsMake a program in c# that runs online
Hello, I’m a beginner in programming and I’ve touched a little with c# but very little! In my work was put a proposal for me to make a program in c#, html or java to store the release of company…
-
1
votes1
answer676
viewsHow to use Updatepanel in gridview?
I have a grid and I want to make it not give postback when clicked on any boundfield (those stock buttons). I did so below, but always updates the page. <asp:ScriptManager ID="ScriptManager"…
-
1
votes1
answer546
viewsProblem loading data with Entity Framework using Include
I’m using the Entity Framework with the Mysql on my system and I need to make a specific query that includes a list of a type of Model (ApplicationUser), in this list each returned object has in its…
c# mysql asp.net-mvc entity-framework lambda-expressionsasked 9 years, 4 months ago Luiz Negrini 1,424 -
1
votes1
answer509
viewsHow to change web.config when running Deploy?
I have an approval and production environment in the cloud but I do Deploy in File System. I have to enter some parameters and change the connectionString for each of these environments. Examples of…
-
1
votes1
answer1084
viewsHow to calculate numbers in a C#string
I have a string that the Arduino sends to my application through the serial port with the following format: variable = #value of ultrasound distance##value of ultrasound distance#...(with 10 samples…
c#asked 8 years, 9 months ago Sergio Caetano 31 -
1
votes2
answers147
viewsProblem with a Count in Asp.Net MVC
My application manages courses, on my registration screen I have a field "amounts of vacancies", where, this is decreasing every time a student enrolls in a course. The problem now is that my Count…
-
1
votes1
answer86
viewsValue between Asp.Net forms C#
Boa Tarde Personal I’m taking the value of a gridview so far so good: gridCadastro.GetRowValues(gridCadastro.GetFocusedRowIndex(), 'id_cliente', OnGetRowValues); Now I need to take this value and…
-
1
votes1
answer399
viewsMount Grid according to XML tags
I have a headache in my project here... I have to consume data from a webservice that sends them in format xml. At the present moment, I can receive this xml of webservice, but I can’t sweep the…
-
1
votes1
answer395
viewsTo delimit a txt file, that is, the line size should be 700 characters for all subsequent lines
I created a routine that reads some tables and generates lines as read. It’s all right at first. but the generated txt exceeds the size of the fields, for example, a field has size 10 and another…
-
1
votes1
answer147
viewsUpdate tables with the same data in the row
When I add a category A, and add a product X with the category A (table categories), then edit the category name A for category B, the category of product X (products table) remains with the…
-
1
votes0
answers106
viewsAggregate with Sort - Mongodb
I have a query in Mongodb, I do Aggregate to count how many items there are in each category, everything works well, however I can’t sort the data, that would be ordered by the Title field. Follow…
-
1
votes1
answer200
viewsiTextSharp deleting document if there are no pages
Well, I have an application that at a certain point generates a PDF with all JPG’s, however, instead of choosing a JPG I choose an Excel file it just moves this file. Right, I’d like to get the…
-
1
votes2
answers931
viewsC# Webmethod - Send and Receive the same object (custom) via Parametro
My code: Object: public class Person { private string _Nome; private DateTime _Nascimento; public string Nome { get { return _Nome; } } public DateTime Nascimento { get { return _Nascimento; } }…
-
1
votes1
answer336
viewsHow to perform a HQL query in C#?
I need to create an HQL query within a method in C#. The structure goes like this: I have the method: IList<int>GetListYear(Guid educationalInstitutionId, Guid academicLevelId, Guid?…
-
1
votes0
answers67
viewsWindows Service running does not connect to database
Good afternoon guys. I created a 3-layer Solution for a windows services project. In debug I can search the database information and do the processes with the return. However, when I put the process…
-
1
votes1
answer685
viewsHow to apply the two add-on to an Hex string in c#?
I need help converting an Hex string into an Hex string by applying two add-on. Example: 0x00FEB5AB 0x00014A55 My Hex. 00FF17DB ? (represents a negative latitude) and 00FCFF75 ? (represents a…
c#asked 8 years, 8 months ago Rafael L Ramon 125 -
1
votes1
answer61
viewsC# - Do not show form being mounted for the user
Hello. In excel VBA has a very cool feature. Application.Screenupdating = False Application.Screenupdating = True This prevents showing the screen being mounted to the user and show only after all…
-
1
votes1
answer60
viewsNumber of accesses per page
Hello, can anyone tell me if IIS has any resource that I can see how many hits each page had?
-
1
votes0
answers57
viewsQuery using Object with Entity Framework
I have a method that gets one object which may be both int as string, someone knows a way to do the entity framework interpret the Object!? I know I can make one if and do the verification, but I’m…
-
1
votes1
answer60
viewsHow to ignore an error using Json.NET without damaging what has already been read
Is there any way to continue the "de-realization" of an object, using Json.NET, even when a property is corrupted and without damaging what has already been "read"?…
-
1
votes0
answers296
viewsIsn’t Admob running at Unity?
I imported the plugin as per admob’s website , plugin link I used the following code for testing using System; using UnityEngine; using GoogleMobileAds; using GoogleMobileAds.Api; public class…
-
1
votes0
answers272
viewsScreen login C# with database Firebird with error
I am doing a project and with Firebird database but, at the time of authenticating the user, is returning true even if there is no user registered in the database with the line if (ER.HasRows), and…
-
1
votes1
answer168
viewsHide Row Gridview C# / ASPX
In a GridView users, if the user himself clicks edit/delete his own account, he would like to know how to hide the Row or disable the GridView but only for the logged-in user, or if clicking the…
-
1
votes1
answer966
viewshelp adding text from richtextbox 1 with richtextbox2 C#
Hello, I would like to know how I do, so when I type in richtextbox1 the text appears in richtextbox2, exactly as if it were a line counter, each time you press enter, only with a number of its own,…
-
1
votes3
answers1339
viewsRelationship between data with combobox
Hello, I have a C# application using Windows Forms My question would be as follows. I have a database made in Access It contains 2 tables, a table called State, which contains Code and State and…
-
1
votes1
answer1981
viewsSave Image c#
I’m having the following mistake Generic error of GDI+. when trying to save the image in a specific directory. I am using code below. string caminho=@"\\\10.1.1.10\\sistema"; Stream myStream = null;…
-
1
votes0
answers590
viewsPrinting of picturebox contents c# in thermal printer (zebra) by serial connection
I received a request at work to print barcodes on the printer you have here (Zebra QL320 plus 1). The first step is done, I was able to adapt a code to generate the barcode; this is inserted in a…
-
1
votes2
answers1560
viewsCheck that SQL Server is installed C#
I’m finishing a C# application that contains a database in SQL Server. How do I know if the user has the SQL Server 2012 Express Local DB installed? It is possible to check via registry in x86 and…
-
1
votes2
answers548
viewsHandling of returns other than JSON
I’m working on an API integration with JSON. I have not implemented anything yet in my code C#, I am for now studying the API but I have already come up with a question. I have a Login method that…
-
1
votes1
answer561
viewsInformation from a User Control to the Parent Window
I’m trying to send some information from my User Control to the title bar of the main screen that would be the parent window. The information I’m trying to send is the company selected from a…
-
1
votes1
answer77
viewsError while trying to add numbers in an int32 array
I am trying to store an array of ints to use periosteally, but came across a syntax error on the part . { 4, 7, 8, 9, 10 } private Int32[] m_FluxosPlataformas = null; public Int32[]…
-
1
votes1
answer157
viewsWhich List Findall method is used in a Datatable
I have the following select below: var Filhos = FluxoWorkflow_ .FindAll(N => N.IdPai.GetValueOrDefault() == dr.IdFluxoWorkflow); I had to change my typed class to a DataTable I’m just not able to…
-
1
votes1
answer287
viewsHow to edit a Boolean field in a list in Asp.Net MVC
Guys, I’m developing an application that manages Courses, and I have the following problem. On my screen Administrator I need the fields Course Name, Student Name and the countryside Approved which…
-
1
votes1
answer65
viewsControls Do Not Appear in Windows 10
After upgrading to Windows 10, the components are missing in my forms, only the cursor appears in the field. I’ve changed colors from the background, from the sources, but it didn’t work.…
-
1
votes2
answers329
viewsBD ACCESS does not accept INSERT or UPDATE
I have a solution in C# with access database that accepts SELECT, but does not accept INSERT or UPDATE, Follow code of the insert button: OleDbConnection con = new OleDbConnection();…
-
1
votes1
answer102
viewsProblem with page return according to C#profile
I am trying to return a page according to the user profile registered in the bank. If his profile is "Admin" returns another page. I try with the Administrator profile and it works, already of…
-
1
votes0
answers85
viewsGet primary key values in Table Adapter
How can I get all primary key values in one Table Adapter. One by one I can get at the time of the Insert with this code: PegaIdOrc = orcTableAdapter.GetDataByMaxIDOrc().…
-
1
votes1
answer61
viewsHow to bring the name of the fields and type of an oracle table in c#
How do I bring up the name and type of fields in a table, using Oracle and C#(WPF)?
-
1
votes1
answer115
viewsHow to change the list type in Asp.Net MVC
How do I change this kind of listing For this type of list below My View @model IEnumerable<MeuProjeto.Models.AlunoCurso> @{ Layout = "/Views/Shared/_Layout.cshtml"; } <h2>Aprovar…
-
1
votes1
answer817
viewsGenerate Class From XSD - CTE for SEFAZ Webservice
Referring to the generation of NFE and CTE classes from XSD for use in the SEFAZ Webservices. I have had some problems of ambiguity in the name of the generated classes. I used the Visual Studio…