Posts by Leonel Sanches da Silva • 88,623 points
2,010 posts
-
14
votes2
answers40729
viewsA: Difference between CROSS APPLY and OUTER APPLY?
APPLY is a command analogous to JOIN, only for functions (FUNCTIONS). According to the Technet: The APPLY operator allows you to invoke a function with table value for each row returned by an…
-
-1
votes3
answers8766
viewsA: Read a few lines from a file
If I were you, I would put the entire process in thread using the native library multiprocessing: https://docs.python.org/2/library/multiprocessing.html For example: from multiprocessing import…
pythonanswered Leonel Sanches da Silva 88,623 -
2
votes1
answer117
viewsA: Problems with references and MVC
The message no suitable method found to override indicates that in the ancestral class there is no method Initialize whatever virtual with the arguments used in the child class method. In this case,…
asp.net-mvc-5answered Leonel Sanches da Silva 88,623 -
52
votes4
answers9003
viewsA: Best way to deal with Exceptions
The question is great, but I’m going to try an answer that is not based on opinions, because the focus of Stack Overflow is not the discussion. There is a way to [better | correct] simply propagate…
-
15
votes8
answers2113
viewsA: Is using customer validation enough?
In a broad sense, no. There the scope involves not only C# and Webforms, but also other technologies. Since the nature of the client can be largely modified (through other scripts, for example), it…
-
3
votes1
answer446
viewsA: How to internationalize Enum values?
In my projects, I implement a Helper (a static class) and call a function that does the corresponding translation, returning the string correspondent of the file of Resource. In the example below, I…
-
3
votes1
answer469
viewsQ: Problem with Custom Routes and Httphandler in ASP.NET MVC
On a project I’m working on, I wrote a HttpHandler to bring as a response an image instead of a View, sort of like this: using System; using System.Web; using System.Web.Routing; using…
-
1
votes1
answer776
viewsA: Replicate/Copy elements from multiple tables
This definition: var newServico = new Servicos(); newServico = servico; newServico.DadosComerciais = db.DadosComerciais.Find(serie, numDoc); You are wrong. You are defining two objects of the type…
-
3
votes2
answers345
viewsA: SQL Server 2005 and line version control
That’s right. The correct is a column called DataDeAlteracao of the kind DateTime, upgradable by Trigger. In this answer, teaching a command to create a Trigger for each table in your database. It…
-
11
votes6
answers73010
viewsA: I installed XAMPP but can’t start apache, Error: Apache shutdown unexpectedly
Answer put as a comment: If you are using the latest version of Skype: Go on Tools > Options > Advanced > Connection. Disable the option Use port 80 and 443 for alternatives for incoming…
-
21
votes2
answers9155
viewsA: What is serialization? When to use? How to implement in C#?
Serialization: What is? In computer science, in the context of data storage and transmission, serialization is the process of saving or transliterating one object on another on a storage medium…
-
1
votes2
answers1016
viewsA: Regex | Take group split
Yes. You are not using the group concept correctly. A group is defined as follows: (?<nome>.*?) To access: foreach (Match grupo in TESTE) { grupo.Groups["nome"]; }…
-
0
votes2
answers1405
viewsA: Best way to add multiple order items to a table
INSERT TB_DETALHES_PEDIDOS (ID_PEDIDO, ID_PRODUTO, QUANTIDADE, PRECO) SELECT pe.ID_PEDIDO, pd.ID_PRODUTO, RAND() * 100, RAND() * 1000 FROM TB_PEDIDO pe CROSS JOIN TB_PRODUTO pd RAND() generates a…
-
10
votes2
answers2787
viewsA: What is syntax sugar and how does it work?
In computer science, syntactic sugar is the syntax within a programming language that is designed to make things easier to read or express. This makes the language "sweeter" for human use: things…
-
2
votes2
answers67
viewsA: Placing two attributes in a cell
You’d have to do something like this: class MinhaEstutura { public int MeuInteiro; public String MinhaString; } The structure, in this case, would look like this: ArrayList<MinhaEstrutura>…
javaanswered Leonel Sanches da Silva 88,623 -
-1
votes2
answers222
viewsA: Creating a collection
Doesn’t seem to be a problem of View: is only a feature of the Entity Framework, which does not load the participants alone because it is a nesting level greater than 1, i.e., loads the passages…
-
2
votes2
answers181
viewsA: How to show the changes made in a SVN review?
svn log --verbose -r <numeroDaRevisao> List with complete directory paths: svn diff --summarize -r<revisaoFinal>:<revisaoInicial>…
-
7
votes3
answers1796
viewsA: Query in an SQL string in C#
This is terribly wrong. The right thing is for you to parameterize your query to avoid SQL Injection: sql.Append("Insert into AppSignin(UserName, FirstName, LastName, Email, Password) Values…
-
0
votes5
answers36671
viewsA: How to get the total character size of an SQL column?
According to Article: http://technet.microsoft.com/en-us/library/ms187745.aspx int supports 10 characters: Máximo: 2.147.483.647 Mínimo: -2.147.483.648 Dynamically speaking, SQL Server can only…
-
3
votes4
answers1585
viewsA: How to make a "Generic Trigger" in SQL Server?
The following script creates triggers for all tables in a database: exec sp_MSForEachTable 'CREATE TRIGGER [?_Update] ON ? FOR UPDATE AS BEGIN SET NOCOUNT ON update ? set ModificadoEm = GETDATE()…
-
1
votes1
answer263
viewsA: ASP Classic in Windows Azure
Because your application needs the DLL registry, it is ideal to use Virtual Machine, as some extra settings will be required. Here are the steps to enable Classic ASP on your Azure site:…
-
1
votes1
answer2006
viewsA: How to wait for a Thread to finish and how to receive values from it?
To get the return of a Function executed in Thread, you need to use a BackgroundWorker: Private WithEvents BackgroundWorker1 As New System.ComponentModel.BackgroundWorker Your final code will look…
-
9
votes3
answers4357
viewsA: Difference between Date, sql. Date and Calendar
java.util.Date is a simple class and only exists for compatibility reasons with previous versions. Actually it is not very useful, because it only keeps dates, without the manipulation operations.…
-
8
votes2
answers4809
viewsA: Entity Framework with Oracle Banks
Yes, the ODP.NET: http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html Here is some more information: http://www.oracle.com/technetwork/pt/topics/dotnet/index-085163.html By the time…
-
5
votes1
answer1763
viewsA: Self relationship at EF6
Set your model class to the following: public class Comentario { [Key] public int ComentarioId { get; set; } public int? ComentarioPaiId { get; set; } public string Texto { get; set; } public…
-
1
votes1
answer1249
viewsA: ASP MVC 4 and Webservice
Log in to SQL Server Management Studio; Log in to your server; Go in the folder Security > Logons; Right-click > Novo Logon; Under Login Name, click Research; Typo IIS APPPOOL\ApPizza and…
-
4
votes2
answers4228
viewsA: How to clone GIT repository with all branches and tags
$ git remote update $ git pull --all
gitanswered Leonel Sanches da Silva 88,623 -
1
votes2
answers2412
viewsA: How to implement an abstract method in a daughter class?
Does not implement inherited Abstract Member Implement Depositar in ContaPoupanca: public override void Depositar(double Valor) { ... } Cannot call an Abstract Member The message already says it…
-
0
votes2
answers957
viewsA: Loading a report in Web Forms
Thus: Response.AddHeader("Content-Disposition", "attachment;.filename=SeuReport.pdf"); // Response.AddHeader("Content-Length", coloque aqui o tamanho do arquivo em bytes); Response.ContentType =…
-
14
votes8
answers61967
viewsA: Should I use input type="Submit" or button type="Submit" in forms?
<button>: You can put images and content inside. <input>: You cannot place images and content inside.
htmlanswered Leonel Sanches da Silva 88,623 -
1
votes3
answers435
viewsA: Problem with users when publishing application
If the database is on a separate machine (as the machine suggests CPSI0024) using an SQL Server Express instance, you need to make an additional configuration to allow remote connections: Initiate…
-
2
votes2
answers217
viewsA: Form in view with subforms in partialView
The <form> should always be only in the parent view. Partial views may even have <form>, but within them you can not use <form>, even because HTML doesn’t even put a <form>…
-
0
votes1
answer213
viewsA: Can I add content tables in the same database as Users? ASP.Net Identity
It’s okay to do that. Contexts are separated in development only by the question of building/destroying the database using the approach Code First. The idea is not to keep creating users every time…
-
3
votes3
answers4757
viewsA: How do I make a Marquee without the <Marquee> tag?
There are some alternatives: Cross Browser Marquee: http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm jScroller - Autoscroller for jQuery: http://jscroller.markusbordihn.de/ Cross Browser…
-
20
votes4
answers22728
viewsA: What are the definitions of method, function and procedure?
Procedure: Part of a program or class that does not return a value (from the Delphi/Pascal definition). In Visual Basic/VB.NET, it is also known as Subroutine (Subroutine, or simply Sub); Function:…
terminologyanswered Leonel Sanches da Silva 88,623 -
10
votes1
answer2491
viewsA: Differences in the dynamic creation of an object
The difference is who is the "owner" of the window. That is, if the "owner" is displaced, all Forms who own this form as owner are also displaced. In the first example, the form is only out of focus…
-
1
votes5
answers501
viewsA: Hover only on some columns
Make another event based on .mouseleave(): http://api.jquery.com/mouseleave/
-
3
votes2
answers183
viewsA: Show information when no data
On Razor, you can do the following on your View: @if (Model.Count > 0) { // Seu código } else { <div>Não há registros a serem exibidos.</div> } For this to be viable you must have a…
asp.net-mvc-5answered Leonel Sanches da Silva 88,623 -
3
votes1
answer663
viewsA: Validation of Client fields in ASP . NET MVC 4
The way to do client validation on MVC4 is through the jQuery.Validation: http://www.nuget.org/packages/jQuery.Validation The attributes placed in your Model are reflected in the View, and the…
-
1
votes3
answers247
viewsA: Switch Result
You can not put code that is not related to switch within the switch because this is bad programming practice. Another thing is to define $sql before you even enter the switch, because there is no…
-
1
votes1
answer151
viewsA: Serialize XML and save to Oracle with C# and ADO
For the first, yes. It looks the same, actually. select NickName, ExternalId1 from Basics where externalId1 = @externalId1 for xml auto, elements; As for the second, SQL Server accepts XPath, but I…
-
4
votes2
answers9026
viewsA: The difference between Software Service and Standalone
Background Process is dependent on and managed by the operating system. Therefore, it is subject to behavior changes with upgrades and migrations. It is usually smaller and does not require much…
-
28
votes2
answers25606
viewsA: What kind of data (double, float or decimal) should I use to represent currency in . NET with C#?
The Decimal is the ideal type for calculating values. It has an enormous amplitude (79,228,162,514,264,337,593,543,950,335 up to -79,228,162,514,264,337,593,543,950,335) and has one of the smallest…
-
2
votes1
answer579
viewsA: Why is the Entity Framework generating a new record in the database?
As I replied on this other issue you are loading the record twice in context and the Entity Framework understands that it is two different records. In your case, this applies to Endereco which does…
-
0
votes2
answers2742
viewsA: How to Migrate SQL Server Database to Oracle
Oracle has a migration guide with videos and textual instructions where all the steps to migration are explained: http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html…
-
1
votes2
answers200
viewsA: How do I get Bitrate Mode from a C#MP3?
The following class implements a good Helper to get various information from a header of an MP3 file: class MP3Header { // Public variables for storing the information about the MP3 public int…
-
5
votes2
answers1234
viewsA: Store shopping cart on customer or server?
On the server. One of the reasons would be that the variable Session evaporates when the user leaves the site or closes the browser. In this case, it would be interesting for the site to "remember"…
-
10
votes7
answers13788
viewsA: How to represent money in Javascript?
Ideal for money representation in javascript is using a more complex data structure, which stores the decimal value, the integer value, the comma separator, etc. There are several small libraries in…
-
20
votes4
answers6910
viewsA: How does namespaces work in C#?
namespaces in c# are sets of identifiers that serve to group common functionalities. For example, in an MVC project, I have a namespace for models (Models), one for controllers (Controllers) and one…
-
2
votes1
answer208
viewsA: Controller and View Structure
If I were you, I would Scaffold of View static same. There’s a Nuget package that does that: Install-Package Mvcscaffolding After having the static View I would do it in Single Page. To generate…