Most voted ".net" questions
The Microsoft . NET is a set of libraries and functions that are part of the Basic Class Library (BCL), such as user interface functions, data access, connectivity, cryptography, web development, mathematical algorithms, and network communication.
Learn more…2,689 questions
Sort by count of
-
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
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
votes1
answer185
viewsDoubt Model Service DDD
I have a question about a project that follows the DDD architecture model. In a service model I need information that is the result of a method from another service, which is the correct way for me…
-
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
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
votes0
answers461
viewsDynamically update ASMX web service reference
I have a C# application that consumes a webservice asmx (which is also developed in C#). Whenever I publish a new version of the webservice, I need to update the reference (of the webservice) in the…
-
2
votes1
answer1438
viewsConsume API fipe in C#
I’m doing studies in C# and Mysql. I created a combobox calling for Marca and another call Modelo. I want to run the FIPE api to look for vehicle makes and models. There is this address below…
-
2
votes1
answer135
viewsFaster way to add an item to an array, using a structure
Structure turma Public id_turma As Integer Public nome_turma As String End Structure Structure Disciplina Public id_disciplinas As Integer Public nome_disciplina As Integer End Structure Public…
-
2
votes1
answer735
viewsHow to convert HTML to RTF?
I have an Asp.Net MVC project where I would like to convert an HTML string to RTF in Controller. I’ve tried the following ways: Source 1 using(var webBrowser = new WebBrowser()){…
-
2
votes2
answers119
viewsWhat is the name of these parameters in ASP.NET MVC?
What is the name of these parameters between brackets used to restrict some access or define the protocol used, as in the example: [Authorize] and [HttpPost]. Is it possible to create a custom…
-
2
votes1
answer55
viewsSql generated by Linq
Hello, I would like to know how to see the sql code that a String expression generates to be executed by ADO.Net. I am using Nhibernate as a ORM framework.
-
2
votes2
answers804
viewsGenerate text file from a console application
I need to adapt this method of an application Windows Forms https://github.com/BoletoNet/boletonet for Console Application, that is, instead of using the object saveFileDialog.ShowDialog() I have to…
-
2
votes1
answer439
viewsStore vector in Sqlite
I am creating an application in C# that must have a database. At first I’m thinking of using Sqlite for simplicity. But for each data entered in my bank must have : Identifying (int, char, bool)...…
-
2
votes1
answer169
viewsIs outputcache only valid at controller level?
I’ve been reading the article: http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/improving-performance-with-output-caching-cs And I started using the: [OutputCache(Duration =…
-
2
votes2
answers2275
viewsCircular reference between two projects
I’m working with two projects in one Solution. To use a form of Projectoa in the Projectob I made reference to the Projectoa in the Projectob, from this I have access to the Projectoa. But what if I…
-
2
votes2
answers5403
viewsCut the last character of a string C#
I’m creating an export from SQL for the TXT. With this I add the ";" tab after building each column. But at the end of the last column you are adding ";" as well. How do I get this ";" from the end…
-
2
votes2
answers998
viewsSearch week number of the year through a date in C#
I’m writing a function that gets a string with a date (format dd/mm/aaaa) and it must return a date (in the same format) 4 weeks later. Example: Entrada: 07/04/2016 saída: 05/05/2016 I read about it…
-
2
votes1
answer1203
viewsError opening application with process.start
I have an app that when trying to run with the process.start or even direct by cmd from Windows, does not start properly (the application itself shows error), but if I go in its folder and open the…
-
2
votes2
answers356
viewsException with timestamp in the database
I want to enter the time and date separately in the database, which have the fields timestamp and data, respectively. And I have the following code to add the fields:…
-
2
votes1
answer580
viewsDatetime attribute error in C# saving to Mysql
I am trying to enter in the Mysql database the date of birth of the user, in C# the attribute data_birth is of type DateTime and in Mysql the attribute data_nascimento is of type Date, to insert C#…
-
2
votes2
answers109
viewsVariable outside matrix boundaries
I’m trying to put the items in positions of a matrix, but I keep getting the error that the variable is outside the matrix limits. I don’t know how to fix the mistake and I need help. Follows the…
-
2
votes1
answer977
viewsError writing file stream
The flow was not writable You receive this exception when trying to change a file that is on Resource. Follows the code: var assembly = Assembly.GetExecutingAssembly(); Stream str =…
-
2
votes3
answers410
viewsCall a method automatically via a partial class on . NET
I created a partial class to the model users where I implemented some custom functions, such as a function that takes the assigned name and surname and generates a handle, see in the following…
-
2
votes1
answer60
viewsBanner Rotary
Hello, use Angularjs and wanted to put it to change the slides from 10 in 10 sec. I’ve tried a few codes and I couldn’t. Anybody got a tip? Here comes my controller. (function () { 'use strict';…
.net angularjs angularjs-directives angularjs-scope angular-moduleasked 8 years, 5 months ago Biellx 461 -
2
votes1
answer334
viewsWhy are you saying this object is null?
papelX.moderador = abc.Id; papelX.participantes.Add(abc); I’m finding a NullReferenceException in that code above. I’m creating an object papelX and I will use some properties of the object abc.…
-
2
votes2
answers286
viewsConvert an Ipaddress to string
This code retrieves the gateway standard, but I can’t convert the result to string and put on a label. public static IPAddress GetDefaultGateway() { var card =…
-
2
votes1
answer70
viewsProblem running eventhandler
I have a class, which is executed under a button, it makes two select in a bank. apos, need to take these two data and make available to use in a second form, I’m trying to make EventHandler,…
-
2
votes3
answers216
viewsWhat are the advantages of working with Fluent Interface with LINQ?
What are the advantages of working with a fluent LINQ interface? I have that code: Employees.Cs. namespace LinqConsulta { class Empregados : List<Empregado> { public Empregados Lista() {…
-
2
votes2
answers356
viewsMerge two items of an Ilist into one item by Id
In my class has: Id Venda Devolucao I have a IList of that class, and in that IList has [0] classe Id = 100, Venda = 230.00, Devolucao = 0; [1] classe Id = 100, Venda = 0, Devolucao = 50.00; [2]…
-
2
votes1
answer709
viewsSet time zone for the whole project
I recently hosted an application on a North American server, so the dates are outside the Brazilian time zone. In this way, I would like to know if there is a way to define the time zone once so…
-
2
votes1
answer894
viewsTryparse error of Datetime converting string in Double format
I have a method of using the DateTime.TryParse to convert a string for the guy DateTime, but lately I’ve realized that string format Double would also be being converted to date. Is there any…
-
2
votes0
answers234
viewsP7s signature with C#
Guys, I have a p7s file that can hold multiple digital signatures, I managed to get the X509certificate2 class to get the last signature that was made in the file, I need to get all the signatures…
-
2
votes2
answers435
viewsConvert String with AM/PM to Datetime
I have a variable that contains a date with AM/PM: string data = "01/08/2016 9:00 PM"; When I try to convert to DateTime using the method TryParse the result ignores the designator "AM/PM". string…
-
2
votes2
answers135
viewsHow to capture information from a 64-bit process that is running?
Well, I need help to capture the information of a running process. I can accomplish this task by accessing the mainmodule 32-bit processes, however, I cannot do the same with 64-bit processes. I…
-
2
votes2
answers912
viewsReading user information
I started studying C#, and my first program (except for hello world hahahaha) is an area calculator. In the code below, after I enter the option (choosing which figure I want) the console simply…
-
2
votes2
answers297
viewsWhat are the differences between Visibility.Hidden and Visibility.Collapsed?
What are the differences between the visibilities Visibility.Hidden and Visibility.Collapsed of the WPF? There are practical or theoretical differences between set the Height and the Width of a…
-
2
votes1
answer83
viewsHow to use an enumerator like Itemsource from a Combobox?
Assuming I have the following: enum Dias {Segunda, Terça, Quarta, Quinta, Sexta, Sábado, Domingo}; How can I use the enumerator Dias as ItemSource of a ComboBox in a WPF application? For example:…
-
2
votes2
answers6086
viewsHow to verify that the framework is installed in the correct version?
Requirements to install the main software: .Net Framework 4.5.1 Service Pack 1 In other words, I am creating a download manager that downloads the correct version of the main software (32 or 64…
-
2
votes1
answer163
viewsJSP for developers . NET
I’m a developer . NET who needs to understand a bug that occurs in a JSP application. (I don’t need to compile or fix, just understand how it is using the database and etc.) I already have Eclipse,…
-
2
votes2
answers422
viewsApplication server
The client has no server (Windows Server or Linux) and does not want to host the system in a data center or in the clouds for example, and you want to use the system on an intranet. Currently 3…
-
2
votes1
answer78
viewsOrganize EDMX Classes
I have a DB First project that uses an EDMX to map the database. The tables have standard columns that exist in all of them and that I could organize and make the code much more generic if it was…
-
2
votes1
answer266
viewsHow do I use an existing database in an ASP.NET MVC C# and Identity application?
I need to authenticate users. So I created my database with all my business rules, connected to the ASP.NET MVC application, and started programming. Now, when I went to do the login user realized…
-
2
votes1
answer75
viewsReduce code that refers to the same object?
Here the code, would you have any way to reduce it? (Just for learning reasons) worksheet.Row(1).Style.Font.FontColor = ClosedXML.Excel.XLColor.White; worksheet.Row(1).Style.Font.Bold = true;…
-
2
votes2
answers743
viewsReceive by parameter a List of miscellaneous objects
I have the following problem described in the comment: public class Funcionario{ public long Id {get; set;} public string Nome {get; set;} public DateTime DataContrato {get; set;} } public class…
-
2
votes1
answer1039
viewsSort list by a string property with number
I have an object of the type Ata where I own the property NroAta which corresponds to the number of the minutes in question, but in grid when I sort by this number, it ends up putting the numbers in…
-
2
votes2
answers213
viewsTreat return in class in C#
I have a class Table: public class Mesa { public int Cdmesa { get; set; } public int Flsituacao { get; set; } public string Status { get; set; } } I would like to return the Status with the…
-
2
votes1
answer352
viewsEntityframework does not recognize Config Web transformation
In my solution C#, I use transformation Web.config to connect a specific data environment, but I’m having a problem with EntityFramework who can’t recognize string de conexão transformed, only…
-
2
votes2
answers1291
viewsWhat is READ_COMMITTED_SNAPSHOT?
What is READ_COMMITTED_SNAPSHOT EF6 Transaction Support About Anyway? What is your use within the Entity Framework?
.net entity-framework entity-framework-6 terminology software-engineeringasked 7 years, 11 months ago Marco Souza 12,304 -
2
votes1
answer624
viewsHow to truncate text without cutting words . NET?
I’ve been trying so many ways for days but I haven’t been able to do this script take the value of <h3> and return the text to it truncated. Javascript: <script type="text/javascript">…
-
2
votes1
answer120
viewsGenerate the primary key in the application or keep it auto-incrementable?
Should I set the primary key of my table as auto_increment or define it as numerical, generating the key within my application? Contextualization I am developing a C# application and testing it in…