Posts by Gabriel Henrique • 175 points
12 posts
-
0
votes0
answers46
viewsQ: UPDATE between 2 SQL tables giving error
I am trying to perform an UPDATE and it brings me the following error: "Message 157, Level 15, Status 1, Line 40 - An Aggregate may not appear in the set list of an UPDATE statement." Follow the…
-
1
votes1
answer669
viewsQ: Set variable with SELECT and WITH in SQL Server
I am trying to set the variable with a query, select only works this way using WITH, but it is giving error when I will assign the value in the variable. The code I’m trying to: DECLARE @contador…
-
0
votes1
answer75
viewsQ: Datagriedview scrollbar track records - C#
I have a Datagriedview where I add my items. When it arrives at a certain number of records on the grid, it adds up and we can’t see the rest. Is there any way to make Scrolbar dynamic? For example,…
-
1
votes1
answer381
viewsQ: Bring last date of SQL Product
I am performing the following consultation to bring the products with their last sale date: SELECT P.ID AS 'Código', p.Nome, CONVERT(decimal(18,2),pe.Valor_Custo) as 'Custo',…
-
0
votes1
answer41
viewsQ: Move Textbox created by code
I’m trying to move a Textbox that was created via code, down. Follow the code where I create and add the button: private DVJPetControles.TextBox txtHorarioCheckin; this.txtHorarioCheckin.TituloLabel…
-
3
votes2
answers1435
viewsQ: SQL query taking too long and returning a Time Out error
I am trying to perform a query in SQL. Below is the method: public void excluirVenda(int Codigo) { Conexao conexao = new Conexao(); SqlCommand cmd = conexao.CreateCommand(); SqlTransaction…
-
2
votes1
answer693
viewsA: Command to open cash drawer
I was able to solve it this way: public static void abrirGaveta(bool flag) { if (flag == true && Properties.Settings.Default.ImpressoraGaveta == 1) { string driver = "TANCA TP-650"; string…
c#answered Gabriel Henrique 175 -
2
votes1
answer693
viewsQ: Command to open cash drawer
I’m trying to make a button that sends a command to open the cash drawer connected to the Tanca TP-650 printer. Below is the method I’m trying. public static void abrirGaveta(bool flag) { if (flag…
c#asked Gabriel Henrique 175 -
2
votes1
answer97
viewsQ: Add another sum result
I’m trying to make a sum of the result of another operation. Below is the code I’m trying to select distinct (SELECT(SUM(CAST(ROUND(ppre.Valor_Custo, 2) as decimal(18,2))) )) * (select…
-
1
votes1
answer682
viewsQ: UPDATE with several records from another table
I have a table T1 where I have the ID. I have a table T2 where you take the ID_T1(Foreign Key) of T1. I have a table T3 where you take the ID_T1(Foreign Key) of T1 and the ID_T2(Foreign Key) of T2.…
-
0
votes1
answer36
viewsQ: SQL Database Log in Restoring Pending
I have an SQL database that was accessed by someone else and it entered "Restoring Pending" as soon as they accessed. Is there any way to extract some log or any other more detailed way to know how,…
-
2
votes3
answers2216
viewsQ: SQL - Bring only 1 year records back
I’m trying to realize a SELECT that brings me only customers who haven’t bought for 1 year without duplicating the customer. Down with the code I’m trying to: SELECT DISTINCT p.ID, p.Nome_Fantasia,…