Posts by Leandro Angelo • 9,330 points
440 posts
-
1
votes1
answer114
viewsA: Microsoft.AspNetCore.Spaservices.Extensions. Does not exist
The error message has nothing to do with version of . Net or C#... Like the Ricardopunctual commented, your project is only looking for local/offline nuget packages and is not looking for nuget.org.…
-
0
votes1
answer23
viewsA: What is the best way to read entity properties in "Include" with similar names?
From your question, I can’t be sure what you’re up to... But if the goal is to remove these ternary conditions and considering that your code is prepared to work with these null values. You can…
-
1
votes1
answer56
viewsA: Search a word or number inside the Archive
As mentioned in the comments, you cannot move the file because it is still being used by some process. That in the case is your own program, which opened it to do the search and did not de-link it.…
-
0
votes1
answer72
viewsA: The Viewdata item that has the 'Name' key is of the 'System.String' type, but must be of the 'Ienumerable<Selectlistitem> type
You are passing the list of Names, which are your roles through the ViewBag.Name // GET: /Account/Register [AllowAnonymous] public ActionResult Register() { ViewBag.Name = new…
-
5
votes3
answers142
viewsA: Multiple cases on switch with C# 8
In this simple example you can declare a variable and use other comparison operators. As for Example: int num = ObterUmNumero(); var descricao = num switch { var i when (i <= 0) => "Inválido",…
-
1
votes1
answer233
viewsA: How to change the language of a website by Javascript?
You don’t need to reload the page, you can simply assign a value to window.location.hash at the click of the buttons and put the functionality inside another Function. var dataReload =…
-
0
votes2
answers101
viewsA: (JAVASCRIPT) How to style the layout of this JS code?
It’s never a good idea to add content to your screen through document.write() as well as composing its content through concatenation, when it could be using interpolation. In this case the ideal…
-
0
votes1
answer62
viewsA: Charts.js Problem to bring Data to the chart!
What you’re implementing, it doesn’t make any sense, but since you insist so much... Even on the google chart, what you’re displaying doesn’t make any sense. It’s just repeating numbers at different…
-
1
votes1
answer90
viewsA: Use Header,Main,Footer as Frames
You can create a function and use the method load() jquery let carregarNaMain = (url) => { $("#corpo").load(url); } <script…
-
1
votes1
answer39
viewsA: ERROR: cannot Convert from 'int' to 'CRUD.Models.Times'
The method in your repository does not expect an argument int which in your case is Id. You can change the method to receive the correct parameter and thus avoid performing another query only or…
-
1
votes1
answer31
viewsA: How to 'scroll' a panel to the end? Javascript + ASP.NET
To ensure that your script will only run after page loading, you need to add a script block waiting for window.onload ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "script",…
-
2
votes2
answers21
viewsA: Problem using loop addeventlistener
The addEventListener one function and not the call of your method, so is running that function the moment you assign; The correct form would be: buttons[i].addEventListener("mouseover", function() {…
-
2
votes1
answer70
viewsA: Write to new column of a csv file using Stringbuilder c#
Simple... you’re doing this, you’re just not writing the rest of the content. Remembering that CSV is a file with delimiters, there are no columns... And in your case the separator is the default,…
-
2
votes1
answer229
viewsA: Renaming objects, properties and methods in Javascript
It doesn’t work because background is only a property of style, that in this hierarchy string is the last object that can be referenced. I don’t see any productivity or practical application for…
javascriptanswered Leandro Angelo 9,330 -
0
votes1
answer47
viewsA: How to replicate the same image in the header? C# Asp.Net
The path of the image is wrong, the way it is will always seek from the relative path <img src="images/icone.png"> What you need is that, despite the route, it is directed in the absolute path…
-
0
votes1
answer199
viewsA: System.Formatexception: 'String not recognized as valid Datetime
Sqlite does not have a specific type for date storage like Sqlserver, by default they are stored with the type Text in ISO8601 string format. Then you need to format your Date in that format. See…
-
0
votes1
answer31
viewsA: I wanted to know how to connect the database data to the chart data in Windows Forms C#
Taking into consideration the Enum below and that you want to display only the totals by gender, you can follow the example below. public enum GeneroEnum { Macho = 'M', Femea = 'F' } Code…
-
0
votes1
answer37
viewsA: Update Textbox data on different . ascx components, but on the same page . aspx
In the origin control, you implement the event of delegate, post the message with the MessageHandler at the click of the button. The source control must have a public method to handle this message…
-
0
votes1
answer65
viewsA: How to generate a PDF from a string
A simple way to run the demand is to simply write the received content into a file .pdf (if your intention is to save that content) //sendo contentString o retorno da sua api var json =…
-
0
votes1
answer18
viewsA: condition for listing
Using the System.Linq to facilitate iteration, you can think of an approach presented below: class Program { static void Main(string[] args) { var a = new int[] { 1, 2, 4, 5, 9, 8, 1, 4, 5, 2, 10,…
c#answered Leandro Angelo 9,330 -
0
votes1
answer36
viewsA: Is it possible to insert two results in the same Dropdownlist? C#
Yes, all you have to do is compose the Text attribute from SelectList, say the Customer’s name is on the Name property.. var clientesDropList = db.Clientes .Select(x => new { Id = x.Id, Descricao…
-
0
votes1
answer98
viewsA: How to use two sensors in the Arduino and show the data in a C#application?
This is what we call an XY problem. Fixing the error in the code is simple, but that doesn’t mean it will solve your problem. The error happens because you try to catch part of the string starting…
-
0
votes1
answer20
viewsA: Layout Logo breaks when exiting Index
Change the image path to always take it from the root <img src="/images/imagem-logo-9A7444CA59-seeklogo.com_preview_rev_1.png" width=60 height=40 /> Or check the appropriate virtual path…
-
0
votes1
answer108
viewsA: Object cannot be converted from Dbnull to other types = Entity Framework Core to Firebird
You need to declare the properties that may receive null values in your entity, as you did with some of them. And you need to check the same thing in the table and in the entity Client. [key]…
c#answered Leandro Angelo 9,330 -
2
votes3
answers79
viewsA: Skip css line keyframes
Or you can replace the <br> for \n and change the innerText instead of innerHtml. So you do not need to restrict by size and can take advantage to apply the effect elsewhere and with more line…
-
1
votes1
answer57
viewsA: Cannot read Property 'value' of null
The problem is that you loop from 0 to 10 and try to manipulate an object that doesn’t exist... In the case, letra0 and your html only has the item from the letra1. Just fix your for. function…
javascriptanswered Leandro Angelo 9,330 -
0
votes1
answer43
viewsA: I’m not getting to import a namespace that I created
What you’re trying to do doesn’t make any sense... it’s not for that purpose that the using exists... For you to have the Enums namespace reference in your second class, you need to make the correct…
-
1
votes1
answer187
viewsA: How not to break the page on iTextSharp split my table into two pages
You can indicate that the object or certain lines must remain together PdfPTable tableUltimoTotal = new PdfPTable(3); tableUltimoTotal.KeepTogether = true; //E ou...…
-
0
votes1
answer22
viewsA: Dropdownlist Scading - Does not load the second dropdownlist
Not to mention the security issues you’re presenting while mounting your queries this way... See that your Action AjaxMethod does not expect to receive a Json object... Asp.net and MVC help you…
-
0
votes1
answer35
viewsA: I can’t access controller
You do not need to mount a string with the Json of your date object, Jquery.Ajax expects a Plain Object as an attribute for this parameter... function DescontoCasa(){ var obj = { empresaId : 1 };…
-
0
votes1
answer138
viewsA: Save information list in txt MVC
The problem is that you are trying to write an object as a string without telling you what exactly you want to present in the file. See below for an example with a fictitious construction. public…
-
0
votes1
answer30
viewsA: Button to enter Records in Database
You are not converting the component attribute to the expected type. You can use the class ImageConverter for that reason. var imageBytes = new ImageConverter().ConvertTo(imagemPictureBox.Image,…
-
0
votes1
answer389
viewsA: Newtonsoft JSON Deserialize List
First the Json that you presented is wrong. That last } is left over "detalhes": [ { "codigo": 00000, "descricao": "CREDENCIADO", "data": "2019-01-15 01:05:36", "ticket": "00000", "mensal": true,…
-
0
votes1
answer40
viewsA: Error 400 when sending a Javascript Buffer Array to a C#Action
You are riding a Json invalid, the correct would be. {"resultado": "seu texto"} Change your javascript function lerCSV() { var reader = new FileReader(); reader.onload = function () { var resultado…
-
1
votes1
answer34
viewsA: Sending an E-mail c#
You need to put some markup to replace the static file value with its dynamic variable. For example, in your EsqueceuASenha.html <html> <body> <b> Sua nova senha provisórioa…
-
0
votes1
answer17
viewsA: Get local connection string, working with (Azure Function)
You will need to inform these connection strings in your appsettings.local.json or configure them as environment variables. To run your code you can set the build parameter in the debug, just…
c#answered Leandro Angelo 9,330 -
1
votes1
answer37
viewsA: How to set a #if or #define conditionally?
If you want this snippet of code to only run when it comes to an android device, you must indicate in #if #if __ANDROID__ // seu código para Android #endif You can even define different behaviors…
-
0
votes1
answer24
viewsA: e. Hasmorepages stays in Infinite Loop
You assign true to it in both conditions... if (hPage > e.PageBounds.Height) as in the else. Have a look at your code. if (hPage > e.PageBounds.Height) { e.HasMorePages = true; hPage = 0; }…
c#answered Leandro Angelo 9,330 -
0
votes1
answer48
viewsA: How to select from the end of a textbox
The way to select the last 7 characters is simple, and you can recover this information simply through the attribute SelectedText, as in the example below. var numeroDeCaracteres = 7; var startIndex…
-
2
votes1
answer233
viewsA: How to send the admin password to windows cmd
If the user who is running the application has the privilege of admin just declare the verb "runas"... but you can pass the authentication credentials with the domain on ProcessStartInfo also. And…
-
1
votes1
answer203
viewsA: Display an object array in Divs
I wouldn’t use Divs to do this construction, but since your question was specific, see the example below. let registros = []; let btn = document.querySelector('#btn'); let osGastos =…
javascriptanswered Leandro Angelo 9,330 -
0
votes1
answer96
viewsA: Asp.Net MVC Enable breakpoint instruction Javascript
In Visual Studio 2019, I believe this feature already exists since 2017, just you enable the option to Script Debugging. But it will only stop at the breakpoints of scripts contained in files .js or…
-
1
votes1
answer68
viewsA: System.Windows.Forms.HtmlDocument.Body.get returned null
It is not possible to manipulate the Documentuntil it has completed its initialization. You can use the filling DocumentCompleted. private void Form1_Load(object sender, EventArgs e) {…
-
0
votes1
answer43
viewsA: align Html.Textboxfor right css
You can use the class float-right @import 'https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css'; .caixa-direita input { text-align: right; } .caixa-direita input text {…
-
2
votes1
answer49
viewsA: Special characters on the return of the Request.Form method
Not special characters, your text is coming UrlEncoded just use Decode to display the way you want. You can use HttpUtility.UrlDecode().
-
4
votes2
answers54
viewsA: Mark Previous Check (Parent) to Node
Following in your structure you can do something like the example below. Thus the main option when clicked interacts with all your children and if there is no child selected the main will be…
-
1
votes1
answer439
viewsA: Passing view data to controller with Viewbag/ how to pass jquery script value to viewbag
To receive the values of your View in Controller, you need to declare the attribute name. The attribute id serves for javascript and css, if the input does not have a name defined it will not be…
-
0
votes1
answer208
viewsA: C# ASP.NET mvc URL encryption
You can add the System.Web.HttpUtility.UrlEncode() as a treatment for special characters generated by obfuscation. public static string EncryptQueryString(string clearText) { byte[] clearBytes =…
-
2
votes3
answers652
viewsA: Web API does not return JSON
You really have nothing to worry about, ASP.NET Web API 2 with the Framework 4.X will serialize the answers as much as XML, how much JSON as defined in the request. You should not worry about how…
-
1
votes1
answer214
viewsA: How to use Streamreader to read the.txt file and insert the data into a List?
Your main mistake is reading a line for each assignment you are doing. Every time you run the sr.ReadLine();, is reading and moving the "cursor" to the next line. Even in your original scenario…
c#answered Leandro Angelo 9,330