Posts by Marcos Barbosa • 377 points
21 posts
-
0
votes0
answers14
viewsQ: Problem with Encoding Losing Accent
I get a file (*.txt) that comes as default ANSI encounter. But every time I read the file it returns me "?" in all characters that have some kind of accent or even the "ç" itself". Ways I have…
-
0
votes3
answers64
viewsA: How to filter only numbers with 'Like' SQL
The like method you can use the "%" operator as either a string suffix or prefix. Example: SELECT * FROM lesson L WHERE L.mainUnitId like 'Ad%'; OR SELECT * FROM lesson L WHERE L.mainUnitId like…
-
-2
votes1
answer56
viewsA: HOW TO ORDER BY COLUMN NICKNAME
WITH myTable AS ( SELECT CODIGO, PRODUTO, VENDIDO, ESTOQUE, PERIODO || ' DIAS' AS PERIODO, (CASE WHEN VENDIDO = 0 THEN 0 ELSE (CASE WHEN VENDIDO >…
order-byanswered Marcos Barbosa 377 -
0
votes0
answers27
viewsQ: Creating a VIEW of a VIEW
I have the following problem in the company, where I have several panels that get information from a VIEW that does not have NOLOCK in the query. In order not to have to change each panel, it would…
-
0
votes5
answers97
viewsA: Doubt with Select using ORDER BY
You can as our colleague Motta mentioned above, using Subselect with MAX. Or: SELECT A.id_a, A.produto, A.tipo, B.id_B, B.descricao, B.dt_renovacao FROM A INNER JOIN B ON A.id_a = B.id_a GROUP BY…
-
2
votes1
answer51
viewsA: If with database select variable
If the ratio is 1 to 1 in the category table, you can write it like this: $confirmado = $mysqli->query("SELECT confirmado FROM categorias WHERE idusuario =…
phpanswered Marcos Barbosa 377 -
0
votes1
answer61
viewsQ: Encoding error in SQL Server Docker
My mistake is this: Type: Error Message: Undefined class constant 'SQLSRV_ENCODING_UTF8' Filename: /var/www/html/api.dev/public/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php My PHP…
-
-1
votes2
answers102
viewsQ: Bitdefender false positive when compiling using Debug Visual Studio 2019 mode
I have an application that I tried in C# to use Confuserex to try to make decompilation a little difficult, but now Bitdefender recognizes it as a Trojan, no matter what I do, change namespace…
-
1
votes1
answer76
viewsQ: Create a configuration ". TXT" file
My problem is this, I need to make a configurable file to integrate to my project, follow its format currently: PRINTER = 127.0.0.12 PRINTER_PORT = 9100 I’d like to format it for this style:…
-
3
votes2
answers82
viewsA: Add decimal values in Mysql
You’re trying to add a string no? Total value would be a field, so the correct query would be: SELECT SUM(ValorTotal) as Pagos, StatusCadastros from pe_cadastros WHERE StatusCadastros = 'A';…
-
-1
votes2
answers83
viewsQ: What does each signal mean in this assignment in C#?
mainSize = mainSize < 0 ? 20 : mainSize ; What do "?" and ":" mean within this assignment of the mainSize variable'?
c#asked Marcos Barbosa 377 -
0
votes1
answer165
viewsQ: Query with subquery
I need to answer this question: 4) Find the name and address of the customers who rented all the films from the video store. I don’t have a way to test the query, but I will do something like this?…
sqlasked Marcos Barbosa 377 -
0
votes2
answers229
viewsA: Get elapsed time from a string
static void Main(string[] args) { int hours, minutes, seconds; DateTime dt1,dt2; dt1 = Convert.ToDateTime("2016-04-16T15:55:53Z"); dt2 = DateTime.Now; dt2.AddHours(3); seconds =…
-
0
votes2
answers229
viewsQ: Get elapsed time from a string
I wanted to calculate the time now with what I get from a string like this: 2016-04-16T15:55:53Z But the time is three hours longer than our time zone, wanted some kind of exit: Já se decorreu 0…
-
0
votes1
answer2628
viewsQ: Sql similar to Excel PROCV
In excel there is the PROCV function, where I can get close values by comparing columns. Ex.: A B Nome Dinheiro Maria 200 João 1000 D E F Categoria Min Max Médio 0 200 Alto 201 1000 If I use call…
sqlasked Marcos Barbosa 377 -
6
votes2
answers9189
viewsQ: Return today’s date in C# in specific format
My way out has to be "2015-02-01" I tried to get DateTime.Now.ToString("yyyy-m-d"), but she doesn’t 0 between days and months.
-
2
votes1
answer1685
viewsA: C# - Display search results in Datagridview (SELECT SQL)
You can use Sqldataadapter and Dataset. string sql_query = "SELECT * FROM Tabela where login='usuario'"; SqlDataAdapter data = new SqlDataAdapter(sql_query, conect); DataSet tabela = new DataSet();…
-
1
votes1
answer43
viewsA: Spreadsheet of excel:
Inside excel you can use the =MINOR(matrix,k) function. Where matrix is the area where the numbers are, and k the position you want, 1 - first, 2 - second...
javafxanswered Marcos Barbosa 377 -
0
votes0
answers46
viewsQ: Only get a snippet of the string in C#
I tried by substring unsuccessfully, get only the text after the second ":". :##########!#######@############### PRIVMSG #barbosza :ds For security reasons I hid some characters with #.…
c#asked Marcos Barbosa 377 -
2
votes2
answers310
viewsQ: Json Array for C#string array
I just need to get the names of the moderators and viewers of this json: { "_links": {}, "chatter_count": 16, "chatters": { "moderators": ["gumagames", "juliavidoto", "nightbot", "pinkpanthersz_",…
-
3
votes1
answer1804
viewsQ: Select taking the difference between Sqlite dates
I wanted a select to give me the following sentence comparing two dates, example: "2015-03-12 13:00"e "2015-03-12 14:15". My return would be something like: 0 days 1 hour and 15 minutes to go... I…