Posts by Pedro Paulo • 3,651 points
138 posts
-
0
votes1
answer75
viewsA: how do I have information passed to the textbox from id
Try to use this code: using (SqlConnection connection = new SqlConnection(@"Data Source=DESKTOP-SEFSOUP\SQLEXPRESS;Initial Catalog=DISPENSA;Integrated Security=True")) { string query = @"SELECT…
-
2
votes2
answers199
viewsA: Check if HTML is visually filled
Use the function children() from Jquery to pick up your div’s children, after which check whether the number of children is greater than zero: if (…
-
1
votes1
answer85
viewsA: Ordination down the line!
As discussed in the comments, you would like to sort decreasingly by the identifier of your objects. To do this, change the line of your foreach as example below, so we will perform the ordering via…
asp.netanswered Pedro Paulo 3,651 -
2
votes1
answer51
viewsA: Filter query by removing duplicates
Group the records and if you have more than one record we will remove it from our return using the clause HAVING: SELECT codemp, codfunc, codevento, SUM(vlrevento) FROM sankhya.TFPFOL WHERE codemp =…
-
3
votes0
answers44
viewsQ: What is the parameter "in" in a generic type in C#?
I came across a C# scenario that I didn’t quite understand. I was studying and I saw a code piece with a generic type that has the reserved word in for that guy. What would be the purpose of using…
c#asked Pedro Paulo 3,651 -
6
votes1
answer90
viewsA: SQL command in C#
You can add an object SqlParameter for every parameter you need. To add parameters in the query just use @nomeDaVariavel, and in the SqlParameter you pass the parameter name without the arroba and…
-
1
votes1
answer68
viewsA: Write to txt
Try it like this: byte[] bytes; using (MemoryStream memoryStream = new MemoryStream()) { using (TextWriter textWriter = new StreamWriter(memoryStream)) { //Altere para o texto que deseja ter no seu…
-
3
votes1
answer1172
viewsA: Check whether date is even or odd
Use the operator % (mod) whether the date is even or odd. If the rest of the day split by 2 equals 0 then we have an even number, otherwise it is odd. Example for SQL Server: SELECT CASE…
-
2
votes2
answers82
viewsA: Create an object reference in your own method
Create an extension method to create your Substring customized, within this method you implement the logic you want. To create an extension method we need to create a static class and static methods…
-
0
votes1
answer61
viewsA: encoding formatting . net
Try to pass the Encoding desired as parameter in StreamReader: var request = WebRequest.Create(url); var response = request.GetResponse(); var dataStream = response.GetResponseStream(); var reader =…
-
2
votes1
answer39
viewsA: Confirmation of form action
You can use the confirm(mensagem) of Javascript, which shows a message (defined by you) to the user and click on Ok she returns true, click on Cancelar she returns false:…
jqueryanswered Pedro Paulo 3,651 -
0
votes1
answer305
viewsA: Entity - Infinite loop in JSON conversion
When serializing your object add the property JsonSerializerSettings and configure to ignore loops when doing serialization. If you are using the Newtonsoft.Json to carry out serialization would be…
-
0
votes1
answer113
viewsA: Setinterval - Chrome Extension
Try creating a function to show the alert(): var registraCPF = setInterval(function() { alert('Registrar CPF') }, 60000);
-
2
votes2
answers1395
viewsA: How to pick up items from a json in c#
The @António response is very well done, because it gives you a way to deserialize your JSON and turn into an object that you can use along the flow of your system. I will give you an answer if you…
-
4
votes2
answers71
viewsA: When to use these commands?
getch The getch() returns the key that was typed by the user, it is commonly used in menus with switch. Return 0; The return is a reserved word of language syntax C and several other programming…
canswered Pedro Paulo 3,651 -
1
votes2
answers679
viewsA: How to pass a parameter from one Action to another Action in the same Controller
Create an anonymous type with the parameter id that your Action Index is waiting: //Aqui eu chamo minha action "Index" e passo o parametro return RedirectToAction("Index", new { id = maloteId });…
-
4
votes3
answers680
viewsA: Help with Sqlquery in context Entity Framework
First create a class that represents the return of your query data: public class RetornoConsulta { public int Data { get; set; } public string Categories { get; set; } public string Name { get; set;…
-
2
votes1
answer93
viewsA: my Bubble Sort does not work well nor a
As our friend @Isac commented, you have quite complicated the logic of Bubble Sort. I will leave below a class that performs the ordering Bubble Sort, evaluate how it works and try to redo your…
c#answered Pedro Paulo 3,651 -
2
votes1
answer119
viewsA: Problem in FK name size
When you create a property with a Dataannotation ForeignKey referencing your browsing property (in this case it is the property Impressao), Entity Framework creates the name of your ForeignKey equal…
-
0
votes2
answers131
viewsA: Syntax error in sql command
Your command SQL is with syntax error between the RG and Address fields (comma is missing between the fields). Below is the changed command: UPDATE FUNCIONARIO SET CPF_FUNCIONARIO=@CPF,…
-
0
votes2
answers219
viewsA: Relative path to txt in ASP
Use the function Server.MapPath("~/WriteLines.csv"). Would look like this: string[] lines = {ENAME, FNAME,LNAME }; System.IO.File.WriteAllLines(Server.MapPath("~/WriteLines.csv"), lines);…
-
2
votes2
answers791
viewsA: How can I print a variable from within the Javascript script?
Use the function console.log() to display your value in the browser console. Press F12 in the browser, then click on the tab console and the value will be displayed in the browser console. Example…
javascriptanswered Pedro Paulo 3,651 -
1
votes1
answer104
viewsA: How to change the value of a button to the value of an array?
Are you trying to change the value of span and the text of this tag is contained in innerHTML. To function normally change from value for innerHTML: function quiz(){…
javascriptanswered Pedro Paulo 3,651 -
0
votes2
answers60
viewsA: Error while reading a Json string
Your JSON is missing the array setting for players and the comma to separate one player from the other, try using the file below: [{ "id": "1", "nome": "Palmeiras", "Atleta": [ { "id": "0", "nome":…
-
1
votes2
answers86
viewsA: Limit index query but not combo query
Change to receive the desired number of records as parameter: private StringBuilder LimitarRetornoLinhas(int quantidadeRegistros = 80) { StringBuilder sql = new StringBuilder(); sql.Append("SELECT *…
-
0
votes1
answer54
viewsQ: Trial version and production version Android
I’m with the following question about managing Android apps. When will we publish a version on Google Playstore (Android), we have 3 options of choice, being them Alpha, Beta and Production. I…
-
2
votes1
answer109
viewsA: Change date display format in View
In your Viewmodel, add a DataAnnotation to the country DateTime: [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)] public DateTime Dtprotocolo { get; set; }…
-
2
votes1
answer38
viewsA: Confirm before making the change
Use the function confirm(mensagem) to know if the user has confirmed the editing action: function edit(event){ if(confirm('Confirma a alteração dos dados?')) { start = event.start.format('YYYY-MM-DD…
ajaxanswered Pedro Paulo 3,651 -
1
votes4
answers1449
viewsA: Undefined object reference for an object instance in array
You created an array of 6 positions, but you did not instantiate the object. Simply instantiate the object that will work: static void Main(string[] args) { DadosFilme[] dados = new DadosFilme[6];…
-
1
votes1
answer548
viewsA: How to enable/disable a Div when clicking the checkbox
Would look like this: $('#chkBloqueio').on('change', function () { if ($(this).is(':checked')) { $('#divBloqueio').css('display', 'block'); } else { $("#divBloqueio").css('display', 'none'); } });…
-
1
votes2
answers246
viewsA: Get "Version Name" [Xamarin.Forms]
We need to use the DependencyService to implement the code for Android and to iOS. First we will create and define our Interface which will contain our return version name method: public interface…
-
-1
votes2
answers412
viewsA: Javascript: How to pick up an array of objects within a child of an array of objects
You can create an array only with the elements as: var grupos = []; $.each(empresa.groupos, function(index, element) { grupos.push(element.as); });
-
1
votes3
answers324
viewsA: Check which p has no text
This would be the code snippet in Jquery: $('p:empty').css('display', 'none');
-
2
votes3
answers7703
viewsA: Remove last number with sql
You can use the function RIGHT , would look like this: SELECT RIGHT(CAMPO, 1) If your field is a number you need to convert to varchar: SELECT RIGHT(CAST(CAMPO AS VARCHAR(50))) Don’t forget to…
-
3
votes2
answers40
viewsA: Back version of the application
The problem is because this version number does not accept the format x.x.x, inform an entire version, for example: 10. I hope I’ve helped.
-
0
votes2
answers288
viewsA: Open Page after Progressbar reaches 100%
The hardest part is to make the bar Progress you have ever made, now just open your url: Redirect your current page to the desired url //Altere para a url desejada window.location.href =…
-
-1
votes2
answers377
viewsA: Timout when searching between 2 date intervals
Try it this way: .Where(p => DbFunctions.TruncateTime(p.DataCadastro) >= dataInicial.Date && DbFunctions.TruncateTime(p.DataCadastro) <= dataFinal.Date);…
-
0
votes1
answer146
viewsA: Create div with append and delete to display another using Jquery
To delete your element use the function remove() jquery: $('#alert-error').remove(); $.each(errorVal, function(i, item){ console.log("messsagem: " + item.defaultMessage) if(item.field === "cpf") {…
-
0
votes1
answer44
viewsA: Problem trying to perform a calculation
In its variable w, you are trying to calculate the square root of f, but there is no such variable declared. To solve the problem declare the variable f and assign a value to it or change its code…
-
2
votes3
answers148
viewsA: How do I know if an Itemtapped has been clicked?
We can create a Timer customized and in it we will have a CancellationTokenSource, where we will register our event to cancel our timer that updates the data with the method AtualizaDados. First we…
-
2
votes2
answers262
viewsA: Set default value when creating an SQL table
Only some details were missing in your query, after some adjustments it would look like this: CREATE TABLE TESTE ( ID NUMERIC IDENTITY CONSTRAINT PK_USUARIO PRIMARY KEY (ID), LOGIN VARCHAR(25)…
-
1
votes1
answer160
viewsA: Execution console hangs while doing many readings in debug mode!
Ramon what is occurring is not a problem, but a misunderstanding of running a program via Visual Studio Console. From your image I can see yellow arrow, which indicates that your code is stopped at…
-
1
votes1
answer138
viewsA: To remove characters to the right of a javascript string if it finds a certain character
whereas the variable minhaString contain value, would be like this: var novaString = minhaString.substr(0, minhaString.indexOf('='));
javascriptanswered Pedro Paulo 3,651 -
1
votes1
answer451
viewsQ: Create a div with links to social networks
Everybody, good afternoon, everybody. I would like a help to create a div with 3 images for social networks, but I would like them to be divided in equal parts, as well as in the image below: So far…
-
2
votes1
answer82
viewsA: Open link in new tab directly in the Ink array
The window.location.href redirects your local tab to the new desired url. To do what you want, we should use the function window.open. Would look like this: function buyVps(){ var…
-
2
votes2
answers91
viewsA: How to access a container within another container in Jquery?
Try to use as follows: $('.buttons').find('[aria-label="Expand"]').remove(); We are selecting all children from the div that contains the class buttons with the selector $('.buttons'). After that,…
-
2
votes2
answers55
viewsA: Input appear with two numbers after the comma
You need your field that will be presented to be a string: string valorTotalPedido = float.Parse(pedidoFornecedor.ValorTotalPedido.ToString("N2")); Or add in your Viewmodel the following…
asp.net-mvcanswered Pedro Paulo 3,651 -
8
votes2
answers138
viewsA: Combobox is not being filled in by the Items I want
How are you filling your combobox with a list of an entity, we need to inform which field of that class represents the description that will be demonstrated and the value that that description…
-
2
votes2
answers684
viewsA: Pass JSON.stringify to Controller
Check the data of your model with the data being passed in your JSON. You should pass values to all fields that do not accept null in your model. Another point is that in your JSON you have fields…
-
6
votes4
answers283
viewsA: Create list with more than one element as if it were multidimensional
By your description you would like to use the structure Tuple<T1, T2>, I’ll leave below an example of what you described that needs: List<Tuple<string, string>> tupla = new…