Posts by Pablo Tondolo de Vargas • 5,444 points
213 posts
-
0
votes1
answer112
viewsQ: Git Manage Branches
I’m looking to manage the new features branches. Currently I can see from Gitlab how many commits the branch is in front of or behind the project’s default branch. However I would like to know if…
-
2
votes1
answer42
viewsQ: Gitlab Pipeline Only Merge Request
I am creating a script for CI on Gitlab, but when using the only merge_requests it is not executed when creating a new merge request. The version I’m using is the Community Edition. When I create a…
gitlabasked Pablo Tondolo de Vargas 5,444 -
-4
votes1
answer604
viewsQ: SQL recursive using CTE
I am mounting an SQL statement using CTE (common table expression) and recursiveness, but I’m getting the following error: Message 530, Level 16, Status 1, Line 5 Instruction terminated. A maximum…
-
5
votes1
answer142
viewsQ: Double map the same entity
I’m trying to map the same entity twice into another public class Conveniado { public int Id { get; set; } public string Nome { get; set; }…
-
1
votes1
answer173
viewsA: ASP.NET MVC after upgrading the packages the default template is lost?
The new version of bootstrap has some break changes. An alternative is for you to fix the package version in Packages.config. <package id="bootstrap" version="3.3.7" targetFramework="net472"…
-
0
votes1
answer284
viewsQ: Difference between Addmvc vs Addmvccore
In some examples I’ve been following, I’ve found two calls on Startup of applications in asp.net-core Addmvc: public void ConfigureServices(IServiceCollection services) { services.AddMvc() }…
-
7
votes1
answer177
viewsQ: Guid.Parse() or new Guid()?
What’s the main difference between using the options Guid.Parse() or new Guid() to convert a string in a Guid? And which of the two approaches would be best used? var usuarioId = new…
-
1
votes0
answers92
viewsQ: ASP.NET Core NPM and webpack/Gulp
I created a project in Asp.net core using the Empty template (dotnet new web). For what I searched, to add packages like Bootstrap or jquery, we have to use NPM, which is basically to add the…
-
0
votes1
answer1171
viewsA: Object reference is not defined as an instance of an object
Or you take your connection chain web.config, or you set her in your class. The error happens because you don’t have your connection string defined in your web.config. <connectionStrings>…
c#answered Pablo Tondolo de Vargas 5,444 -
6
votes1
answer1670
viewsA: How to implement methods and classes by some keyboard shortcut in visual studio?
What Visual Studio provides for you, are the Code Snippets. With this feature, you are able to create several different types of code snippets. Within the scope of a class, when activating the Code…
-
2
votes1
answer795
viewsA: How to call function in procedure
Simply call the function as follows VerificaExistenciaDoProcesso('calc.exe');
delphianswered Pablo Tondolo de Vargas 5,444 -
5
votes1
answer873
viewsA: Entity Framework Update Database
After a few weeks struggling with this problem, I made some discoveries. The first is that the path to the DLL Microsoft.Build.Framework in the archive devenv.exe.config that’s in the folder…
-
4
votes1
answer84
viewsA: How to control migrations in two distinct contexts?
You must add the parameter -Context in charge Add-Migrations Add-Migration Teste -Context:DoisContext.Data.OutroContext In the example I set up my Context are as follows public class OutroContext :…
-
0
votes1
answer601
viewsA: Update DIV with Ajax Asp.Net C#
You can use javascript’s Setinterval function, which will make your code repeat from time to time as defined. setInterval(function(){ $.get('@Url.Action("GetData", "Home")', function (data) {…
-
0
votes2
answers818
viewsA: C# Convert Dataset to JSON
I made an example where I use two Tableadapters in 1 Dataset string connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString(); using (SqlConnection connection = new…
-
2
votes1
answer60
viewsQ: Sumasync return zero
I have an appointment in LINQ where do I use the SumAsync, however when my entity is empty I have the exception: The cast to value type 'System.Decimal' failed because the materialized value is…
-
0
votes2
answers2588
viewsA: C# Call Controller method Asp.Net MVC5 with Ajax
If you want to simply pick up (GET) the information, you have to use the attribute HttpGet in his Action. [HttpGet] public JsonResult GetData() { List<Dados> qry = new List<Dados>();…
-
0
votes1
answer301
viewsA: Document search screen with paging and search filter with Asp.net
I will post the form I use for my ASP.NET MVC searches with Entityframework. I define a ViewModel with the parameter fields and a list of the search results, this class will also have the paging…
-
0
votes2
answers922
viewsA: Generate PDF in c# without using Microsoft.Office.Interop
Has the library Report.NET which is even open source. Here is an example of a class to generate the PDF using the library public class Report<TClasse> : Report where TClasse : class { private…
-
4
votes2
answers489
viewsQ: ASP.NET Core Isdevelopment
When creating a project with the dotnet cli dotnet new Razor -o Razorpagescontacts How do I change the environment variable to developer mode when running the application using dotnet run. Since in…
-
2
votes2
answers266
viewsQ: ASP.NET Razor Pages error while processing the request
I’m implementing an example using ASP.NET Razor Pages and when trying to access the page Index I have the error that there is error in the request. Error. An error occurred while Processing your…
-
0
votes3
answers878
viewsA: App.config to access an SQL Server database?
To access your SQL Server, your app.config has to have connection strings <connectionStrings> <add name="NomeDaStringDeConexao" providerName="System.Data.SqlClient" connectionString="Data…
c#answered Pablo Tondolo de Vargas 5,444 -
1
votes2
answers195
viewsA: LINQ query with sum
Another possibility is to start the consultation by the Accession entity already filtered for paid, along with a group by. var dados = _db.Adesoes .Where(b => b.Pago) .GroupBy(a => a.Contrato)…
-
7
votes2
answers195
viewsQ: LINQ query with sum
I have the following appointment at LINQ var dados = _db.Contratos .Where(a => a.Adesoes.Any(b => b.Pago)) .Select(a => new { Contrato = a.Numero, ValorTASenior = a.Adesoes.Where(b =>…
-
6
votes1
answer873
viewsQ: Entity Framework Update Database
When executing the command Update-Database I have the following error Could not load file or Assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, Publickeytoken=b03f5f7f11d50a3a'…
-
0
votes1
answer438
viewsA: How to use Esc to stop a program in the middle of its C execution?
With the use of the function getch you can pick up the character that was typed on the console, in which case the number 27 represents the keyboard ESC. #include <stdio.h> #include…
canswered Pablo Tondolo de Vargas 5,444 -
2
votes2
answers2606
viewsA: Check whether the previous day is a holiday and/or Sunday
First I tried to use only the type Datetime in its algorithm. Another detail, the Datetime.Now returns the current day, soon if it is Monday, the previous day is Sunday, to catch Saturday, you have…
-
2
votes1
answer287
viewsA: Update console line with C#
You can use the Console.Write printing on the same line. I made use of the Setcursorposition setting the cursor position on the screen. a = a + 1; Console.SetCursorPosition(0, Console.CursorTop);…
-
0
votes1
answer109
viewsA: How to capture backdate
You can use the setDate function to set the date by decreasing your 15 days, see the example function dateFormat() { var initialDate = new Date(); initialDate.setDate(initialDate.getDate() - 15);…
-
1
votes1
answer731
viewsA: Onchange function does not work
You can use jQuery to do as follows to call the Onchange. $(document).ready(function () { function validateEmail(emailField) { var reg =…
-
4
votes2
answers223
viewsA: Scroll through buttons and text box with tab
There is the option Tab Order in the Visual Studio which facilitates the sorting of components. By clicking on this option the Visual Studio will show how your Tab Order. Simply click on each of the…
-
0
votes1
answer454
viewsA: How to Include and Reference . JS in my project?
In Forms web project, to add the reference to a script, you can do it as follows. <script type ="text/javascript" src="Scripts/JS/validacao.js"></script> However, I prefer to do the…
-
5
votes1
answer3990
viewsA: Difference between Thread.Sleep and Task.Delay
Taking into account the following example private void button1_Click(object sender, EventArgs e) { Thread.Sleep(10000); } private async void button2_ClickAsync(object sender, EventArgs e) { await…
-
1
votes2
answers1436
viewsA: How to center layout
In the element properties, you will find the option Layout and define the Anchor for None.…
-
0
votes1
answer64
viewsA: Error when trying to calculate factorial,per passing meter
I reread your example by taking the parameter long int *fat of its factorial function and declared the fat as a local variable in the function. #include <stdio.h> #include <stdlib.h>…
canswered Pablo Tondolo de Vargas 5,444 -
2
votes1
answer38
viewsA: Visual Studio Error 2015 Update 3 cannot remove breakpoint
You can delete all breakpoints using the menu debug | Delete All Breakpoints. To view all the breakpoints what your solution has, you can see in Debug | Windows | Breakpoints…
-
0
votes1
answer488
viewsA: How to perform a Left Join with LINQ C# using my SQL?
To have the left Join in the Entity Framework you will have to do the following from d in banco.Doacoes join p in banco.Projetos on d.IdProjeto equals p.IdProjeto join pedi in banco.Pedidos on…
-
1
votes4
answers1377
viewsA: filter object by javascript array
I set an example for you using the function filter var alunos = [{ nome: 'teste', idade: '15', turma: 'turma 1'}, { nome: 'teste2', idade: '16', turma: 'turma 2'}, { nome: 'teste3', idade: '12',…
javascriptanswered Pablo Tondolo de Vargas 5,444 -
3
votes1
answer515
viewsA: Change column value in Firebird
Aós include your column, you can give a update in your table for cases where your field is null. update tabela set campo = 'S' where campo is null
-
1
votes4
answers814
viewsA: Why can’t we return a void call in a void return waiting method?
What happens is that the instruction Return ends the execution of the method in which it appears and returns the control for the call method. It can also return an optional value. If the method is a…
-
1
votes1
answer134
viewsA: Ado.Net and Entity in the same project
If the doubt is whether the two work together, yes the two can work together Look at the example I put together class Program { static void Main(string[] args) { InserirDados(); UsandoAdo();…
-
2
votes1
answer305
viewsA: Develop an MVC project with Web API
MVC is a design design that conceptualizes separation in Model, View and Controller. In the ASP.NET Web API, we have separated the Model and the Controller, we did not develop a user view, but if…
-
1
votes0
answers262
viewsQ: Return a Partialview in ASP.NET MVC
On returning a Partialview my action can both have as a return Actionresult as a Partialviewresult. public PartialViewResult Franquias() { return PartialView("_Franquias"); } Or public ActionResult…
-
3
votes1
answer186
viewsA: Formula within a Field
I set an example using the exec SET NOCOUNT ON; --crio uma tabela temporária para simular a sua tabela CREATE TABLE #formulas_table( formula varchar(100), A int, B int, C int) --insiro uns dados de…
-
1
votes1
answer3485
viewsA: Update Multiple Columns
Yes you can, your update statement would look like this update SB1300 set B1_DESC = 'novo valor', B1_CODBAR = 'novo valor' where B1_XCODORI = /*sua condição*/
-
1
votes2
answers386
viewsA: Call function by passing field
The first thing I did was remove the onchange="HideTextBox(this);". Using the jquery, I searched the element using the following notation $("[id$='ddlIDType']"), where the id$ which would be the way…
-
0
votes1
answer52
viewsA: Doubt on how to Map an Interface with a Class - Simpleinjector
As I observed in the documentation of simpleinjector, for you to use the Lifestyle.Scoped, you need first of all to make sure that the option continer.Options.DefaultScopedLifestyle is properly…
-
0
votes1
answer236
viewsA: Problems with a Dependency Injection Container - Simple Injector
What happens is that your call to container.Register is wrong, you are trying to do dependency injection using as if the Restarter was Generic, where the correct is that it waits 3 parameters,…
-
4
votes2
answers5772
viewsA: How to save the entire project using Visual Studio Code
You can enable the Auto save on the menu File. Also on the menu File has the option of Save All, that would be the combination of shortcut Ctrl + K S. But to function you have to press the Ctrl + K,…
visual-studio-codeanswered Pablo Tondolo de Vargas 5,444 -
0
votes1
answer751
viewsA: Division error by zero - Query SQL
Testing if it is null will not help you much in the way you are doing, because if the value of working hours remains zero, you will still get division error by zero. Most likely its function…