Posts by Vanderlei Pires • 299 points
12 posts
-
3
votes1
answer30
viewsQ: How to join sublists with Linq
Imagine I have the following classes: public class Pedido { public int PedidoId { get; set; } public List<ItemPedido> Itens { get; set; } } public class ItemPedido { public int ItemPedidoId {…
-
2
votes3
answers3588
viewsA: How to store more than one value in an "SQL variable"?
You can use the instruction FOR XML: DECLARE @UNIDADE VARCHAR(100) = '' set @UNIDADE = ( select NOME + ',' from UNIDADES Where CODIGO_UNIDADE In (:UNIDADE_INFORMADA_PELO_USUÁRIO) for xml path('') )…
-
1
votes1
answer55
viewsQ: Conversion of a LINQ query into methods
The following query in LINQ (with query) below is used to list all vendors that have an account (relationship 1 to 1): from f in fornecedores join c in contas on f.ID equals c.FornecedorID select f…
-
2
votes1
answer1023
viewsA: Use Forms Authentication in an ASP.NET Core application
I ended up answering my own questions: There is no way to use Formsauthentication in ASP.NET Core anyway setting up the Target Framework for NET47 ? Not, using directly the Formsauthentication class…
-
0
votes5
answers41630
viewsA: Mysql Limit Equivalent in SQL Server
A solution equivalent to Mysql that does not require ORDER BY and that works in any version from SQL Server 2000 is: SELECT TOP 100 * FROM Tabela WHERE Coluna1 NOT IN (SELECT TOP 50 Coluna1 FROM…
-
1
votes1
answer188
viewsA: Create a jquery option Selected
It was not very clear what the dynamic form would be, but just use $("select").val("joao"), follows a functional code using your example: var button = $("button") button.on("click", function() { var…
-
0
votes1
answer1023
viewsQ: Use Forms Authentication in an ASP.NET Core application
I’m migrating a website ASP.NET Web Forms (.NET Framework 4.7) to ASP.NET Core (but still using the . NET 4.7 as "target framework") - the goal is to use Razor Pages, dependency injection and other…
-
0
votes2
answers31
viewsA: Javascript - Objects
You have to define the constructor method before: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Objetos</title> </head> <body>…
javascriptanswered Vanderlei Pires 299 -
0
votes1
answer65
viewsQ: Best way to ensure consultation isolation
I have the following scenario: A table in SQL Server that contains process records that can be run on multiple services (Windows Services in C#) from multiple servers. Something like: CREATE TABLE…
-
1
votes1
answer70
viewsA: No repetition of SQL SERVER code
You can use label and goto, even not making sense in this context would look like this: DECLARE @AG_NUM varchar(15) DECLARE @BCO_NUM VARCHAR(3) DECLARE @AG_NUM1 varchar(15) DECLARE @BCO_NUM1…
-
1
votes1
answer79
viewsA: SQL Procedure improvement
The trick is to make a query to save all possible values from the "Tag" column first: declare @cols nvarchar(max) set @cols = stuff(( select distinct ',' + MARCA from Tabela_Produtos for xml…
sql-serveranswered Vanderlei Pires 299 -
2
votes1
answer245
viewsA: Inner Join is returning repeated results
Missing to relate the keys of the tables (FK of the people_treatment with the treatment PK) in JOIN, as @Rovann commented would look like this: select t.nome from tratamento t inner join…