Posts by Jéf Bueno • 67,331 points
1,254 posts
-
46
votes1
answer20752
viewsA: Is it possible to do an UPDATE with data from another table?
It is possible to make a Inner Join UPDATE Tabela SET Tabela.Col01 = Outra_tabela.Col01, Tabela.Col02 = Outra_tabela.Col02 FROM Tabela INNER JOIN Outra_tabela ON Tabela.id = Outra_tabela.id WHERE…
-
6
votes2
answers1281
viewsA: Good practices in declaring variables in a for
Just to be clear: there is no benefit in terms of performance therein. Resharper’s intention is to make the code cleaner and more organized. Therefore, moving the variable to a more internal scope…
-
5
votes1
answer726
viewsA: Parse error: syntax error, Unexpected '='
PHP variables should be prefixed with $ and not with @. Just change the code to: <?php $connect = mysql_connect("localhost","root","") or die ("Erro na conexão"); mysql_select_db("tcc") or die…
-
4
votes1
answer64
viewsA: Write file to database with Nhibernate
Yes, it is possible. In C# the type has to be byte[] and not File. Not least because File is a static class, you will never be able to use an instance of File. In the mapping would be: Property(x…
-
10
votes2
answers2268
viewsA: What is the difference between Tolistasync() and Tolist()?
ToListAsync() is the ToList asynchronous. Asynchronous methods can be executed without locking the application’s main execution line. E.g.: in a Winforms application, do not lock the GUI in long…
-
2
votes1
answer179
views -
1
votes1
answer101
viewsA: C# ASP.NET Get method with parameter returning 404
The attribute Route is not being used properly. You should use them in actions and not in controller, in the controller one should use RoutePrefix to set a "prefix" for the route. public class…
-
6
votes2
answers1010
viewsA: Recursive search in all directories and Ubdirectories of a given folder
Just do a check if fl is a directory using File.isDirectory() and call the method again by passing fl as a parameter. private static List<File> listarArquivos(File source) { List<File>…
-
1
votes1
answer281
viewsA: When testing my web API C# ASP.NET locally on Fiddler it returns an error 404
This happens because the controller person with the name PessoaController1. The controllers need to have only Controller at the end of the name. Rename the class PessoaController1 for…
-
4
votes2
answers1509
viewsA: How to add items in a dynamically Java combobox?
Since you have no further details, I’ll give you the most general answer possible. Just use the method addItem combobox.addItem("Item 1"); combobox.addItem("Item 2"); combobox.addItem("Item 3");…
-
4
votes1
answer184
viewsA: How to delete the first and last name of a string
There are several ways to do this. The simplest is to use the methods IndexOf and LastIndexOf combined with the Substring. using System; using static System.Console; public class Program { public…
-
2
votes1
answer61
viewsA: How to create guides inside a window?
You need to use the component TabControl. He is the "controller" of tabs, the container theirs. The tabs themselves are the control TabPage.…
-
7
votes2
answers489
viewsA: Sqlserver Trigger after update
Basically, this is it CREATE TRIGGER [dbo].AfterUpdateOrInsertEmail ON [dbo].email AFTER INSERT, UPDATE AS BEGIN IF EXISTS (SELECT * FROM [dbo].invalido inv WHERE inv.ds_valor = (Select…
-
3
votes1
answer171
views -
6
votes1
answer102
viewsA: Calculated field with RU
Supposing Clientes be the DbSet of Cliente and db be the data context Sum all customer vehicles 1 var qtdVeiculos = db.Clientes.Find(1).Veiculos.Count(); Or var qtdVeiculos = db.Veiculos.Count(v…
-
2
votes1
answer32
viewsA: Error searching in Database
It is necessary to surround the value of aero in simple quotes, which is how Mysql will understand that this is a literal string and not some identifier. stmt = con.prepareStatement("SELECT * FROM…
-
5
votes2
answers438
viewsA: Bubblesort random numbers
Your sorting algorithm is working perfectly. The problem is that there are no elements in the array vetor. In the first for the generated values are only shown in the console, they should be…
-
8
votes6
answers4503
viewsA: If null, Nan, false and Undefined in Javascript
Since Javascript is dynamic, you can try to "coerce" the conversion of these values to boolean, this will make all the items cited (null, undefined, false, NaN, ""), equal to false. If you compare…
javascriptanswered Jéf Bueno 67,331 -
6
votes1
answer39
viewsA: How to set default properties for variables that start with specific text?
Just need to use a little Reflection modelBuilder.Properties<string>() .Where(p => p.Name.StartsWith("descr")) .Configure(p => p.IsOptional());…
-
4
votes1
answer688
viewsA: How to set a string-like field to nullable in Code First?
Using Fluent API just add the method IsOptional in the declaration of ownership. Ex.: (in the method OnModelCreating) modelBuilder.Entity<Papeis>() .Property(prop => prop.descrPapel)…
-
17
votes1
answer1055
viewsA: IIS mount server on PC at home
Yes. There is how. I don’t know to what extent this question is pertinent to our site, but I will explain it to you anyway, succinctly, in a few steps. Install the IIS Go into programs and resources…
-
3
votes1
answer55
viewsA: Add Wordpress user in more than one function
Directly I think it’s impossible. The documentation is extremely shallow, she says the following A string used to set the user’s role. In free translation String used for "set" to "role" user’s At…
-
1
votes1
answer468
viewsA: How to insert an object and a list of objects in the same request
It would work, although it doesn’t make any sense. Once you are using Viewmodels, you can simply use it as a parameter of your action. public ActionResult Add(FornecedorContatoViewModel…
asp.net-mvc-5answered Jéf Bueno 67,331 -
4
votes4
answers3402
viewsA: How to detect the operating system with Python?
Simple (like almost everything in Python :p) - The outputs are from the test I did in my OS >>> import os >>> print os.name nt >>> import platform >>>…
-
7
votes4
answers1255
viewsA: Index returning -1 in Java Arraylist
The indexOf() takes as parameter an object and returns its index. You are passing a number as parameter, so it does not work. To find an account by its number, you will need to scroll through the…
-
2
votes1
answer8459
viewsA: Sublime Text does not appear menu bar on Ubuntu 16.04
Keystone Alt, this will show the menu. To make it always visible, go to View > Show menu. Usually the software uses the key Alt to show/hide the menu. It is also possible via command. Press Ctrl…
-
1
votes1
answer1477
viewsA: Exception 'Input character string was not in an incorrect format' when calculating
It turns out that TextBox1.Text must have a value which cannot be converted into number. Try to validate this, print it on the screen or on the console before trying to convert to number. My guess…
-
1
votes2
answers582
viewsA: Pass information between C#RMS
You can do this with a public property in the secondary form public partial class FormOpenDirectorySystem : Form { public bool Sucesso { get; private set; } = false; public FormOpenDirectorySystem()…
-
1
votes2
answers996
viewsA: Metodo Json - Return
The part on the controller is working Okay, but those System.Console.WriteLine are completely unnecessary. Another thing, return ex.Message when an error occurs can be a problem. That way you return…
-
2
votes1
answer318
viewsA: How to Reset a Gridview c# aspnet?
You will need to set the DataSource as null and then clear the lines of the DataGridView. GdvInfo.DataSource = null; GdvInfo.Rows.Clear(); dt = info.RetornaInfo(x,y); GdvInfo.DataSource = dt;…
-
6
votes2
answers25412
viewsA: Using WHERE with INNER JOIN
Just add the cloister where in consultation SELECT CodCli, NomeCli FROM tbvendas INNER JOIN tbclientes ON tbvendas.CodCli = tbclientes.AutoCod Where Status = 'debitado'…
-
8
votes4
answers640
viewsA: Java abstract class exercise doubt
You just iterate the HashSet and print what you want //Chamada do método imprimir(fa); //Declaração do método public static void imprimir(Set<FuncionarioAbstract> funcionarios) { for…
-
9
votes4
answers320
viewsA: What is .= in php?
Is the same as += in other languages. Since PHP is not typed, .= is used to strings, it adds the text to the right of the existing text in string. $texto = "Hello, "; $texto .= "World";…
-
1
votes1
answer294
viewsA: Rising Counter in a Texbox
Are you trying to convert one TextBox for the whole and not its text. If you want to use the text, use the property Text int valor = Convert.ToInt32(textBox44.Text);…
-
6
votes2
answers1051
viewsA: Copy data from one field to another
Without much detail it is difficult to help you, but using jQuery, the basis is this $('#bt-copiar').on('click', function(){ $('#txt-wpp').val($('#txt-tel').val()); }); <script…
-
3
votes1
answer103
viewsA: Error searching by name Access ASP.NET C#
As the error message itself already says, it is not possible to stop a parameter null pro method AddWithValue. You will need to perform a validation and if the string is null, send the value as ""…
-
3
votes3
answers182
viewsA: Linq filttar elements of LEFT JOIN
You will not be able to filter the items of a browsing property. The only way to apply a filter to the child records is by query separate. Obviously the forms below consider that you are using Lazy…
-
1
votes2
answers566
viewsA: Display selected input value
To show something whenever the value of input is changed (typed, deleted, pasted), you can use the event onInput. $('#input-id').on('input', function() { alert($(this).val()); }); It is also…
-
2
votes1
answer127
viewsA: How to pass a JSON Object to a method in the webservice?
You need to pass an object that has the properties defined in the model. In the current form, an object is being passed with the property UsuarioJsonModel and this property is the object you need.…
-
3
votes1
answer156
viewsA: Not In Linq Sql Entity Framework
The problem is that when you do db.Notifications.Select(o => o.EntityId) the return is a int (assuming this is the kind of EntityId) and you’re applying the Where on the return in Select.…
-
8
votes1
answer2880
viewsA: How to Perform Procedures with Dapper
Assuming you wanted to get the result in a variable of type Cliente. var cliente = connection.Query<Cliente>("spClientes", new {Id = 1}, commandType: CommandType.StoredProcedure).First(); The…
-
3
votes1
answer238
viewsA: How to get all parameters in a GET request with Silex?
You can use $request->request->all() that will return you an array with all parameters. Additional Outside the option you already know $request->query->get('nome'), you can put the…
-
3
votes2
answers12706
viewsA: How to know if a decimal number is even or odd?
This is more a question of mathematics than of PHP itself. Only numbers whole can be classified in odd or even. To answer your question. What is the essence of whether it is even or odd? Just check…
-
2
votes2
answers72
viewsA: Visual Studio 2015 says "this" is redundant
Is there any reference/coding pattern that always recommends using thisde where my teacher might have taken it? No. At least nothing widely spread, even because it would not even make sense. The…
-
2
votes4
answers2059
viewsA: How to Verify the existence of an Id in a document via Jquery?
You don’t necessarily have to use jQuery for that if(document.getElementById('fundo_index')) //elemento com id "fundo_index" existe else //elemento com id "fundo_index" não existe…
-
0
votes1
answer973
viewsA: Error to leave application authenticated by Windows
Add this snippet to web.config. If you are going to use Windows authentication, it is not necessary to have the personification of ASP.NET active <system.web> <authentication mode="Windows"…
-
2
votes1
answer71
viewsA: the local variable `Texture' cannot be declared in this Scope because it will Give a Different Mean to Texture
You cannot declare two variables with the same name (texture), even if one of them is inside the if. Just rename one of the variables. if (this.modalStyle == null) { //... } var rect = new Rect(10,…
-
14
votes2
answers3665
viewsQ: What’s a chain list?
I’ve been reading some materials and I’ve seen a lot of talk about chained lists. I even saw the code example (in C) below that tried to "illustrate" what was a. struct Node { int info; struct Node…
-
7
votes2
answers2567
viewsA: How to format a date displaying the month name in angular?
Use the filter date. Passing by MMM as parameter, the output will be the shortened month name (Jan - Dec). Using MMMM the departure will be the month name in full (January - December). It is also…
-
2
votes2
answers366
viewsA: Integration going into loop
Console.WriteLine(""); It is a method used for applications of the type console (dirt, right? ). It serves to write something on the screen, show something to the user. The "problem" of your code…
asp.net-mvcanswered Jéf Bueno 67,331