Posts by Samuel Renan Gonçalves Vaz • 720 points
28 posts
-
0
votes1
answer71
viewsQ: Group By select
I have an Employee table with the fields Name, Age, Gender and Company. And each employee may or may not be in more than one company. With that I made the following select in this table. select…
-
0
votes1
answer107
viewsQ: Extract date in text column
There are other ways without use Regex to extract data of a text column in Oracle 19c. So far I managed using Regex as follows: select REGEXP_SUBSTR(p.observacao,…
-
1
votes3
answers69
viewsA: How to ignore other occurrences like this when capturing a snippet of a string?
If you’re sure the Id is always the beginning of the string and after the Id always has room, can do with the method Split() thus. using System; namespace Main { class Program { static void…
-
3
votes4
answers20874
viewsA: How to extract only numbers from a string?
A solution without use Regex: var cpf = "111.222.333-44" string.Join("", cpf.ToCharArray().Where(Char.IsDigit)); reference Soen…
-
1
votes3
answers15990
viewsA: Mascara CPF/CNPJ ANGULAR 8 NG-MASK
In angular version 8 o ngx-mask does not have the implamentation of CpfCnpj dynamically, only from version 9 of Angular and using the version 9.1.2 of ngx-mask to solve this problem. For those who…
-
5
votes4
answers823
viewsQ: Transform String Array into Object Array
I got the following Array string: ["TagFuncao:CN Evento:TODOS", "TagFuncao:DOC.AGRO.INDUS Evento:TODOS"] I need to transform this Array into an Object Array where TagFuncao and Evento is property of…
-
1
votes3
answers1452
viewsA: How to create a category tree in C#
I’ve been through the same situation and solved using Linq as follows: using System.Collections.Generic; namespace XXX { public class TreeviewItem { public TreeviewItem() { Children = new…
-
-1
votes2
answers991
viewsQ: Transform matrix into vector
I am doing some exercises with matrix and array, and I arrived at the following situation: static void Main(string[] args) { int linha = 3; int coluna = 3; int[,] matriz = new int[linha, coluna];…
-
3
votes1
answer82
viewsQ: What are the differences in backend and frontend?
When we use async and await in the backend and frontend ? Is it better? It’s worse? Other related questions: An API, for example in C#, if all methods are async and await, I can say it’s better than…
-
-1
votes2
answers107
viewsQ: Numericupdown lock down
How to block or control the "Down" state of the Numericupdown component of Windows Forms ? Ex: First time the user makes a "registration", he can Add or Remove the Quantity, in the second…
-
2
votes1
answer328
viewsQ: Web API does not accept parameters in the constructor with Autofac
I created an API to query client, this is my configuration: public static class AutofacWebapiConfig { public static IContainer Container; public static void Initialize(HttpConfiguration config) {…
-
3
votes1
answer148
viewsQ: Viewmodel’s communication: return data to previous screen
I have a screen A that has a text field and a button, that screen button A, opens a second screen B. That screen B has another text field to fill and save, when the person click save the screen…
-
-2
votes2
answers116
viewsQ: Is there any way to simplify this amount of conditions?
I have the following code: foreach (var lote in collection.ToList()) { count++; ushort[] dadosBalanca = new ushort[9]; if (lote.AlvoPasso > ushort.MaxValue) { var subtracao = (lote.AlvoPasso -…
-
1
votes2
answers266
viewsQ: How to use Distinct() or Groupby() in a list that returns an anonymous type?
I’m doing a select on the bench to bring the IdNavio and Navio, but I don’t want to bring the repeated. I’m trying to use the methods Distinct() and GroupBy(), but they’re not working, I’m using the…
-
2
votes2
answers426
viewsQ: View Mapping with Entity Framework
I am doubtful how to map a View created in Oracle Bank 11G with Fluent-API. Here is an excerpt from the view with alias: tran.id_transporte AS "ID Navio", tran.ds_nome_transporte AS "Navio",…
-
-1
votes1
answer446
viewsQ: How to know if foreach is going through the last item on the list
I created an application in console and a foreach to go through my list of integers: var lista = new List<int>() { 2, 6, 1, 4, 20, 21}; int count = 0; foreach (var item in lista) { count++;…
c#asked Samuel Renan Gonçalves Vaz 720 -
1
votes3
answers100
viewsQ: Convert decimal to ushort
I need to convert a value decimal for ushort in my application: Is there such a possibility? If yes, how to convert? I tried to use the Convert.ToInt16(value), but it didn’t work. Console example:…
-
2
votes2
answers155
viewsQ: Convert date 20171130 to format 30/11/2017 in string
I have this date field '20171130' saved in the database, and I need to convert to string formatting "30/11/2017" in my application, how to do this type of conversion ?.
-
1
votes1
answer277
viewsA: Formatting chart values using Syncfusion for Xamarin Forms
In contact with the support of Syncfusion: You can reach this requirement by setting a Datatemplate with a Ivalueconvert to data marker and using property Chartdatamarker.LabelTemplate. See the…
-
4
votes1
answer277
viewsQ: Formatting chart values using Syncfusion for Xamarin Forms
I’m using the Syncfusion to create graphics in Xamarin Forms. Studying the documentation, I could not find a way to format the values of my chart, example: I want these values formatted for…
-
7
votes2
answers674
viewsQ: Remove an N amount of days on a date
How to remove an amount of N days in a date ? namespace TesteData { class Program { static void Main(string[] args) { var dataAtual = DateTime.Now.Date; // dataAtual 13/09/17 var qtdDias = 5; //Como…
-
2
votes2
answers1697
viewsQ: Date range C#
I have a table in the bank called Quota, this quota has two columns one for data_start and data_end, so far so good, now I have another table called Order that also has data_start and data_end,…
-
3
votes1
answer149
viewsQ: Add() method does not add Timespan to Datetime
I created a Datetime with some values started in the constructor, but when I add a Timespan with some values, it does not add together with the date. I am using the Datetime method to add a…
-
1
votes1
answer60
viewsQ: Xamarin Forms change commit
Every time I change or create a new file in my project in Xamarin Forms and do Clear and Rebuild in the project, it generates files in the debug folder, and at the time of committing to the…
gitasked Samuel Renan Gonçalves Vaz 720 -
0
votes1
answer580
viewsQ: Ajax sending template to controller
I wonder if it is possible to pass a "Model" object via ajax to my controller. $.ajax({ type: "POST", url: "@Url.Action("CadastrarSementesVariedades", "SementesLevantamentoVariedades")", data:…
-
1
votes1
answer40
viewsQ: Actionlinkbutton Boostrapmvc - Passing values to controller. "MVC - C#"
I’m trying to create a button with boostrap mvc, which when clicked will open a new tab with the data I want, but for that I need to pass an id to my controller, someone could help me because I…
c#asked Samuel Renan Gonçalves Vaz 720 -
5
votes2
answers954
viewsQ: Exhaust character
I’m having trouble understanding the escape characters, I already know that the \n break line in a string, but the other characters could not understand. Ex: \a \b \f \r \t \v, found the…
c#asked Samuel Renan Gonçalves Vaz 720 -
6
votes2
answers436
viewsQ: Delegates and methods
When to use delegates? Being that a delegate points to a method, it is not the same thing as creating a normal method? What’s the difference and when to use and why to use? It’s better? Is worse?…