Posts by Jeferson Almeida • 3,076 points
74 posts
-
3
votes2
answers576
viewsA: What is Initialization Vector?
In its context the iv is a random character set, usually they are used to ensure that your encryption is always unique, and should always be generated a new one when using it, preferably never…
-
4
votes2
answers1194
viewsA: Fill a Datatable from a list of a complex type
Besides catching the PropertyType you have to check if he is Nullable, so I slightly modified your first is to make this check and add when needed. To create the rows just create an array in the…
c#answered Jeferson Almeida 3,076 -
4
votes5
answers1923
viewsA: Is it possible to update the first 100 lines in sql(server)?
That’s possible, just put one TOP(100) after update, e.g.: UPDATE top(100) tbl_venda SET produto=1 WHERE produto=3
-
4
votes1
answer65
viewsA: Jquery find key from a value
You n need jQuery for this, there is a native function of the Javascript prorpio that already does this, is the indexOf(), follows an example of how to use it var minhaarray = [5,10,15,20,25]; var a…
-
1
votes1
answer40
viewsA: Should I use prepare in Procedures
The ideal is for you to continue using the prepare to assemble their procedures. Probably, when it was commented that procedures would not need the use of prepare, it is because they use past…
-
6
votes2
answers7919
viewsA: How to join 2 select in mysql
You will have to use the operator UNION between them, in your case would be so: SELECT DISTINCT a.id, a.unidade, a.posicao, a.nome, a.peso FROM produtos a, produtos_pedidos b WHERE a.id =…
-
3
votes2
answers166
viewsA: Count IF Mysql Workbench
One of the solutions to your problem is using a Subquery to show the amount of records, in case it would look like this: SELECT id, (SELECT Count(id) FROM tabela t1 WHERE t1.id = t2.id GROUP BY id)…
-
0
votes2
answers323
viewsA: How to get source of request in Asp?
I believe what you need is referer = Request.ServerVariables ("HTTP_REFERER"), follows a link with all the options of Servervariables. Just stating that the HTTP_REFERER does not work in all cases,…
aspanswered Jeferson Almeida 3,076 -
4
votes1
answer1323
viewsQ: Make comparison using String.Contains() disregarding accents and case
I need to check how to make a comparison between strings, in C#, using the method Contains() that so disregards the sensitivity of accents and marry of a string. Example: var mainStr = "Acentuação";…
-
1
votes3
answers4806
viewsA: Split the database to multiple clients or create one for each?
It is possible to create a database through the PHP, for this you just run a database creation command, follow a simple example: <?php $link = mysql_connect('localhost', 'mysql_user',…
-
3
votes1
answer232
viewsA: User who has permission to create other SQL Server users
To create a login you need one of the following permissions ALTER ANY LOGIN or ALTER LOGIN To create the user you will need the following permission ALTER ANY USER The login is for it to connect to…
-
2
votes2
answers269
viewsA: Problem with AJAX request return
What happens is actually cache, what you can do is send a random parameter in your request, or disable the cache in the request. To disable the cache just do it this way: function…
-
1
votes3
answers10183
viewsA: What is the difference between UNIQUE and PRIMARY KEY in Oracle?
Primary Key: There can be only one in a table Primary Key is a unique identifier of a record in a table Unique Key: Are unique by table record There may be more than one Unike Key in a table Allow…
databaseanswered Jeferson Almeida 3,076 -
1
votes1
answer618
viewsA: Display a <div> when you click the close of the browser window
In case you could run a javascript that displays an Alert or modal for this, eg: <script> window.onbeforeunload = function (event) { var message = 'Você tem certeza que deseja sair?'; if…
jqueryanswered Jeferson Almeida 3,076 -
1
votes2
answers554
viewsA: Update and Insert data into a table with information from another bank
There are some ways to do this in PostgreSQL. You can use the dblink for example. insert into clientes select * from dblink('dbname=postgres hostaddr=xxx.xxx.xxx.xxx dbname=A user=postgres', 'select…
-
2
votes5
answers1664
viewsA: I want to put the number of characters and put whether it even or odd
In case you don’t need to give a int.Parse, because the same is already an integer. Also you do not need to fetch the value again in the console, because you already have your word in the variable…
-
2
votes2
answers283
viewsA: Change variable values in a function through another function?
One more solution to the problem <body onload="getfoucs()"> <select id="select_compra" data-limit="3"> <option disabled selected style="display: none"…
javascriptanswered Jeferson Almeida 3,076 -
2
votes1
answer61
viewsA: Join for 2 tables
In case your John is spelled wrong. Follow below as it would be +- the correct form, depending on how your entities are: var chamadaMusicas = db.ChamadaMusicas .Include(c => c.Chamada) .Include(c…
-
5
votes1
answer70
viewsA: How to handle C# data from a table that is bit-like in sql server?
In case you will have to convert the information to Boolean. Would look like this: alerta.DataHoraCadastro = dr.GetBoolean(12);
-
3
votes3
answers182
viewsA: Linq filttar elements of LEFT JOIN
I found the following library that already abstracted it. http://entityframework-plus.net/ Using it the Bible would look like this. var results = db .Fornecedor .IncludeFilter(f =>…
-
3
votes3
answers182
viewsQ: Linq filttar elements of LEFT JOIN
I would like to return an object with your children, but I just wanted you to bring the children that corresponded to a certain condition. ex: I have the following classes: public class Fornecedor {…
-
7
votes1
answer129
viewsQ: How to map an image attribute by Fluent API?
I would like to know how to map an attribute of the type image of SqlServer by the Fluent API. In my bank I have the following table: CREATE TABLE [dbo].[ProdutoFotoERP]( [ProdutoFotoID] [int] NOT…
-
2
votes1
answer283
viewsA: Tuples separated by commas
In the MySQL you can use the function GROUP_CONCAT to do this, in your case would look like this GROUP_CONCAT(DEPT.nome SEPARATOR ', ') as nome This function serves to group your string by a desired…
sqlanswered Jeferson Almeida 3,076 -
1
votes2
answers725
viewsA: Select Aninhado
In this case the only thing you need to do is add your Where in the first sentence, in your case it would look like this SELECT menu. NAME AS Nome, city. NAME AS Cidade, count(*) AS qtdAcessos FROM…
sqlanswered Jeferson Almeida 3,076