Posts by LeoHenrique • 954 points
75 posts
-
1
votes1
answer32
viewsA: How to write this query using lambda Linq in c#
Hello, try something like this: odb.Linguagem.Join(odb.Cadastro, l => l.Lin_ID, c => c.Cad_IDLinguagem, (l, c) => l) .Where(x => x.PROPRIEDADE == VERIFICAÇÃO) ).ToList();…
-
-1
votes1
answer67
viewsQ: Exception when trying to open modal
Error ERROR Error: Staticinjectorerror(Appmodule)[Meucomponent -> Renderer]: Staticinjectorerror(Platform: core)[Meucomponent -> Renderer]: Nullinjectorerror: No Provider for Renderer! at…
angularasked LeoHenrique 954 -
1
votes1
answer38
viewsQ: Field disabled if condition is true
I have a value editing and installments view... In this view I have 2 fields, 1 button and a list (where I can edit the line so that the status is paid): In this list contains a status column, if…
angularasked LeoHenrique 954 -
2
votes1
answer94
viewsA: What is Membership for?
The providers Roles and Membership provide the resources to manage authentication and authorization. Where authentication is the process for verifying user identity and authorization refers to the…
-
2
votes1
answer48
viewsA: Doubts about validation for the implementation of the modal
Do so: if(validacao) { ... // O que tem que ser feito caso validação esteja certa. return RedirectToAction("VIEW_VALIDACAO_OK"); } else { ViewBag.Erro = "MENSAGEM PARA A VIEW"; return…
c#answered LeoHenrique 954 -
2
votes1
answer173
viewsA: Conversion failed when Converting the varchar value 'COL' to data type int
In your View, the field where you are being filled with 'COL' in Visual Studio may be as string, but when sending the command to insert in the bank, there is a conflict of types, probably in the…
c#answered LeoHenrique 954 -
1
votes0
answers18
viewsQ: Am I using the Asynchronous Task correctly?
Hello, I am doing a project in ASP.NET MVC and wanted to use an asynchronous task. In my stock I have: public async Task GerarItens(int codigo) { using (var dbTran =…
-
1
votes2
answers43
viewsA: Error with Abstract method
All excerpts from these answers were taken from this source: https://docs.microsoft.com/pt-br/dotnet/csharp/language-reference/keywords/abstract Since an abstract method statement does not provide…
c#answered LeoHenrique 954 -
2
votes1
answer91
viewsQ: Count how many children the father has (Self Related)
Table: FilhoID INT PK, PaiID INT FK Query: SELECT FilhoID, PaiID, (SELECT COUNT(PaiID) FROM tabela WHERE PaiID = FilhoID) as 'Total Filhos' FROM tabela My doubt: My SELECT within the SELECT, I…
sql-serverasked LeoHenrique 954 -
1
votes1
answer158
viewsA: Help with COUNT mysql and Asp Net Core
Make an object that receives this 2 information and then send it to the View Model public class ObjStatus { public int quantidade{get; set;} public string status {get; set;} } Repository public…
-
6
votes3
answers20560
viewsQ: Pick first and last name and abbreviate middle names only with the initial
I would like to address the following string: string nome = "Rafael Rodrigues Arruda de Oliveira" With the following criteria:: Keep first and last name; Abbreviate the other names (middle names)…
-
1
votes3
answers20560
viewsA: Pick first and last name and abbreviate middle names only with the initial
string nome = "Rafael Rodrigues Arruda de Oliveira"; string primeiro = ""; string meio = " "; // Sim, tem um espaço aqui! string ultimo = ""; string[] nomes = nome.Split(' '); // Separa cada nome…
-
0
votes2
answers122
viewsA: SQL-C# ~ Add Student if not in class
Make a SELECT to check if there is the student who wants to include the class already exists: public int ExisteAluno(int idAluno) { string strQuery = "SELECT id FROM tabela WHERE personsID = @p_id";…
-
1
votes1
answer143
viewsA: Specify custom View paths in ASP NET Core 2.0 MVC 5?
Each folder in your View is usually related to one of your controller, so if you want to trigger another view from another controller, that is, from the same folder, you only need to use the…
-
2
votes1
answer44
viewsA: Doubts about Sessions and Roles
In the controller folder, find ManageController. Inside this, find and click on ApplicationUserManager and tighten F12. Will open the class IdentiyConfig. Above this class where you ended up, add…
c#answered LeoHenrique 954 -
2
votes2
answers127
viewsA: Prevent Insert or Update If date is in a Registered range
On your Rigger do this check: IF EXISTS(SELECT * FROM inserted WHERE inserted.DATA1 < DATA2) rollback tran Alas for your problem, treat as necessary the following part DATA1 < DATA2…
-
5
votes1
answer687
viewsQ: How to use the Foreign Key annotation in C#?
I am layman and would love to learn about. I will use in the example Model A and B not to get confused: I saw about the Model A take note Foreign Key in prop virtual Model B virModelB referencing a…
-
2
votes1
answer70
viewsA: Doubt on the link of two tables to bring in view
In the foreach of his View, you need to call the marMarca from within the Marca of item of your foreach Thus: <td> @item.Marca.marMarca </td>…
-
2
votes2
answers4510
viewsQ: Round Up SQL SERVER
I’m making a SUM(x) and I need to divide it by 8, for this example, my result will be 5.5. The result needs to be like an INT and rounded up.. So for this example, I need the result 6. I’ve already…
sql-serverasked LeoHenrique 954 -
3
votes1
answer679
viewsQ: Rows in Columns without Column Preset - SQL Server
Hello, I’m having a hard time turning rows into columns on SQL Server. I haven’t been able to write anything yet... I thought about PIVOT, but since it’s not always the same amount of columns, I’m…
sql-serverasked LeoHenrique 954 -
0
votes1
answer68
viewsQ: Red item on screen prevent Submit - Javascript/Jquery
I have a view with 3 divs and 20 input number in every row of my div and a input submit. Every line comes from my bank. (For this example I will use only 3 inputs number). Those of mine divs are…
-
1
votes1
answer71
viewsQ: List item for loop variable C#
Is there any way I can make one for or foreach in a list and within this I create variables for my obj items EXAMPLE: public class Pessoa { public int ID {get;set;} public string Nome1 {get;set;}…
c#asked LeoHenrique 954 -
0
votes1
answer53
viewsQ: Foreach jquery concatenate in table
I have a AJAX that in the success brings a response: $(response).each(function(i) { alert(response[i]); $('#tbody').html( "<tr>" + "<td>" + response[i].id + "</td>" + "<td>"…
-
-5
votes1
answer237
viewsQ: Substring after character C#
Good Afternoon string nr = ABC:1 I’d like to take the number after ":" as I would? nr = nr.substring(...); Expected result: for nr = ABC:50 nr = 50; for nr = LKfasEWF:5039 nr = 5039…
-
1
votes2
answers401
viewsQ: Controller Dynamic Fields - ASP.NET MVC
I have this JavaScript that creates new fields for me when I need and that makes the call to create the JSON. This counter within the function adicionarCampos() is necessary for something else…