Posts by Rodrigo Santos • 209 points
9 posts
-
0
votes3
answers4590
viewsA: SQL use variable in column name
Just add parameters with the same name as the variables in your query. Example: var connect = new SqlCommand("String de conexao"); var command = new SqlCommand("SELECT IDLayout, Nome, @collum,…
-
5
votes2
answers239
viewsA: How to turn a method into a class?
Just right click on your project, go to add and then click on class. I recommend that you name the class with a noun that represents it and the method with the action that it actually does. Your…
-
1
votes1
answer122
viewsA: Validation of fields in cshtml
These fields can be validated by data annotations as in this example I did in my blog, or using jQuery validation as in this example (jQuery validation attributes that will be passed to the method…
-
1
votes3
answers3820
viewsA: Changing LABEL value by Jquery or Javascript does not work in ASP.NET
The .value javascript has only utility in elements <input /> where the . innerHTML when you want to get/modify the internal content of an element, such as div’s, label’s and span’s. Sources:…
-
0
votes3
answers3981
viewsA: Declare variable within my cshtml
Who will do this data control is your controller. If you want to pass this value to it just put the name attribute of your input with the name of the variable that will be received in your backend.…
-
2
votes3
answers2384
viewsA: Media Player Classic libraries in my Windows Form project
I don’t think there is a simple way to do this in Windows Forms, I suggest you use WPF, because it already has components specifically made for this and that are very simple to work with, also as…
-
8
votes2
answers181
viewsA: Confusing encapsulation in c#
To avoid the set being public too, you can do so: public class Pessoa { public String Nome {private set; get; } public Pessoa(String nome) { Nome = nome; } }…
-
0
votes2
answers222
viewsA: What difference xmldocument vs xmlwriter?
Xmldocument is a more complex class than Xmlwriter, as it contains more methods for handling xml while Xmlwriter basically serves to record this xml.
-
0
votes2
answers1555
viewsA: Calling action with AJAX, but does not return Alert to view
What happens is that when the request is made by ajax in a method that returns one is Actionresult/Partialviewresult is returned the object and not that HTML that is generated when a normal request…