Posts by Pablo Tondolo de Vargas • 5,444 points
213 posts
-
0
votes1
answer226
viewsQ: Reading txt with Streamreader
When reading a TXT file, of accounting releases exporting by a third party system, being my problem in the lines that have the Nº. VLR REF SOMETHING NO 1834 MORE TEXT Using the class StreamReader as…
c#asked Pablo Tondolo de Vargas 5,444 -
3
votes2
answers448
viewsA: The "Color.Name" property or indexer cannot be assigned, as it is read-only
If you want to change the color of label. The property you need to work on is the ForeColor and if you want to change the background color, it is not assigning the Name you can, just assign the…
-
2
votes3
answers857
viewsA: Dollar next to number in Tostring format
An alternative for you would be to take the currency symbol and concatenate with the value using decimal formatting N2. Would look like this: Decimal value = 1106.20m; Console.WriteLine($"Current…
-
1
votes1
answer323
viewsA: Group items in application table Asp.net web MVC
You must like your view to receive a model of the type IEnumerable<IGrouping<out TKey, out TElement>>. Taking into account that the CodPro be a whole, your view would look like this.…
-
3
votes3
answers58
viewsA: SQL Query - Doubt Condition Dates
Just putting the @Rovann response in context The DATEADD returns a date. O MONTH returns an integer representing the date month. Soon your cloistered Where MONTH(TarVencimento) =…
-
0
votes4
answers4494
viewsA: What is a Static function for?
Within a class definition, the keyword static declare members who are not bound to class instances. Outside the definition of a class, it has a different meaning: see the duration of storage.…
-
2
votes1
answer279
viewsQ: EXCEPT equivalence | INTERSECT & exists | not exists
Would be the EXCEPT | INTERSECT always equivalent to a not exists | exists? Having the following consultation SELECT ProductID FROM Production.Product INTERSECT SELECT ProductID FROM…
-
3
votes1
answer179
viewsA: Migrations, Updating a null field to not null
Add to your Up() an update setting the CPF to empty when it is null, but before the AlterColumn. public override void Up() { Sql("update dbo.Users set CPF = '' where CPF is null");…
-
0
votes1
answer172
viewsA: Taking a string from an XML I received from an http request
First I believe your variable url is not your XML returned by web service and yes you should have Xml on the return of your sponse. WebRequest req = WebRequest.Create(url);//acessa httprequest…
-
5
votes1
answer328
viewsA: How to show a Messagebox when selecting an item in the combobox
The ComboBox has an event SelectedIndexChanged, just implement it and add a MessageBox to show the desired message. Something like private void comboBox1_SelectedIndexChanged(object sender,…
-
1
votes1
answer22
viewsA: Error after View is called
A technique that I use to discover errors of calls via ajax, is to simulate the call directly by the web browser to action in question. In your case, you could request the following URL…
-
1
votes1
answer181
viewsQ: Automating deploy using Msbuild
I’m creating a bat to compile and publish a Visual Studio project using MSBuild. However, I need to inform a user and password for the MSBuild. What I am doing, is to solitar in the bat the user and…
-
3
votes1
answer98
viewsA: Verification in login form
Dear Pedro, first of all, never use string concatenation to assemble your SQL clauses. So you avoid the SQL Injection. I put together an example of how I would look using parameters. string conexao…
-
1
votes3
answers886
viewsA: Load Datagridview with Mysql
The signature of the method CarregarAluno is returning a string and at a certain point you try to return a DataTable. This is your main compilation problem. To resolve, change your method signature…
-
1
votes1
answer218
viewsA: Insert Mysql syntax error
One problem I’ve detected is that you’re mislinking the instruction insert. Try to arrange for the following way $sqlCadastraTarefa="Insert into Tarefas (nome_TAREFA, dataInicio_TAREFA,…
-
1
votes1
answer63
viewsA: Problem with RAND in SQL
According to the Mysql documentation, the function RAND([N]), return a floating point between 0 and 1.0. To get a random integer R being i <= R < j, you need the following expression FLOOR(i +…
-
3
votes1
answer150
viewsA: Task is not called
I believe that the best option for you would be to integrate the Hangfire to your project. First install the nuget package PM> Install-Package Hangfire In your class Startup add to the method…
-
0
votes1
answer42
viewsA: Problem in defining Foreign key
What you lack is to set the Id column in your Team table as the primary key. To add a primary key to a table, you can use the command ALTER TABLE. Your syntax is: ALTER TABLE table_name ADD…
-
1
votes1
answer928
viewsA: How to set Foreign key in oracle SQL Speed?
Right click on the table where you want to add FK, select the menu Constraint and then select Add Foreign Key. In the window that opens, fill in the information: Name: name of your FK Column Name:…
-
3
votes1
answer141
viewsA: doubt expression Innuendo, clause IN
You can make a where and in it use the Contains string[] filiais = { "11.111.111/0001-11", "11.111.111/0001-12", "11.111.111/0001-15" }; var retorno = (from ven in context.VendaModel where…
-
1
votes1
answer401
viewsQ: Report Viewer Schema 2016
When adding a parameter to a ReportViewer is happening from the version of schema move to 2016, which brings me to the following error when trying to render the report Message: Test method…
-
1
votes1
answer55
viewsA: Error in application Asp.net mvc
When I had this problem, I solved it by finalizing the process VBCSCompiler.exe and everything was back to normal. But after the last updates of Visual Studio I no longer had this problem. To finish…
asp.net-mvcanswered Pablo Tondolo de Vargas 5,444 -
1
votes1
answer81
viewsA: Foreach in an Actionresult of details
First I believe your class RegistroCompleto should contain a ICollection details. All you have to do is load the details into your action as follows: public ActionResult Details(int? id) { if (id ==…
-
4
votes1
answer95
viewsQ: String Contains Empty returns true
Why when using the Contains("") in a string not empty returns true? Example if ("MinhaString".Contains("")) { Console.WriteLine("String contém vazio"); }…
-
0
votes1
answer393
viewsA: How to import log file into Asp.net mvc with Entity framework
You can use the filehelpers. Here are some examples of how to use it Data delimited by comma 1732,Juan Perez,435.00,11-05-2002 554,Pedro Gomez,12342.30,06-02-2004 112,Ramiro Politti,0.00,01-02-2000…
-
2
votes2
answers1003
viewsA: Report generated with reportview, directly in pdf
I will help you with the code I use to generate the PDF file from ReportViewer Warning[] warnings; string[] streamids; string mimeType; string encoding; string filenameExtension; byte[] bytes =…
c#answered Pablo Tondolo de Vargas 5,444 -
1
votes3
answers437
viewsA: Visual Studio INSERT command error
First you must declare the columns that will be inserted in your instruction insert. Another very important thing, never concatenate SQL statements as you are doing, if you concatenate your SQL…
-
0
votes1
answer46
viewsQ: Mapping 1 to 0, 0 to 1
I need to create a map between two existing entities, where both are independent. So. I have an entity DepositoTransferencia and the other is Conta. The idea is that at a given time, the entity…
-
2
votes1
answer2607
viewsQ: Change existing column to Identity
Having an entity where the first key is an integer and the same is defined not to be an Identity public class Teste { [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int Id { get;…
-
0
votes3
answers378
viewsA: Doubt SQL query d
I will help you with the query to return the number of working days of the month. declare @startDate datetime = '01/04/2017' declare @endDate datetime = '30/04/2017' DECLARE @totaldays INT; DECLARE…
-
0
votes1
answer210
viewsQ: ASP.NET Web API post Byte[]
I’m creating a Web API and my model has a property byte[], but every time I try to make a Post my model arrives null, taking away the property byte[] he usually arrives the model. [Table("Pessoas")]…
-
0
votes1
answer655
viewsQ: Tdatetimepicker Windows 10 Update
After upgrading Windows 10 to version 15063.38 the fields TDateTimePicker have come to have an unpleasant look. As much as I select a date, it remains showing only the bars. However, in versions…
delphiasked Pablo Tondolo de Vargas 5,444 -
6
votes1
answer1199
viewsA: Select and do not return values containing xxx
You need to use the like to filter those that have AUD and adding the NOT we will only have those that do not end with AUD. SELECT TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME NOT LIKE '%_AUD' ORDER…
-
1
votes2
answers1031
viewsA: How to count down in a Messagebox
I have a form where in it I have two buttons, and in one of them I use a timer to enable In the FormShow procedure TfrmMensagem.FormShow(Sender: TObject); begin inherited; fCaption := btn1.Caption;…
-
3
votes1
answer831
viewsA: Automatic class generator
With the version core of Entity Farmework it is possible to use the direct command line on Package Manager Console Scaffold-DbContext…
-
0
votes2
answers189
viewsA: Include 2 Yen in 1 View!
In your view, you just need to change your model to use your class PromocaoLancamentoViewModel @model SiteJapaBrindesDDD.MVC.ViewModels.IndexPromocaoLancamento.PromocaoLancamentoViewModel <div…
asp.net-mvc-5answered Pablo Tondolo de Vargas 5,444 -
1
votes1
answer87
viewsA: How to pass "Isauthenticated" parameter to actionfilter?
Matheus, an alternative for you would be to not pass the Request.IsAuthenticated as a parameter for your LogActionFilter and rather use the IsAuthenticated within your OnActionExecuted, being as…
asp.net-mvc-5answered Pablo Tondolo de Vargas 5,444 -
6
votes1
answer94
viewsQ: What is Accelerated Mobile Pages (AMP)?
By chance I ended up reading on an administration portal where I talked about digital marketing trends for the year 2017 and what caught my attention the most was the AMP. Which led me to the…
-
0
votes2
answers622
viewsA: Constructor method for calculating age
In reality the constructor will not calculate age unless you have an Age property and the constructor assigns the value to that property. public class Pessoa { private string nome; private string…
-
2
votes1
answer1391
viewsA: Save data from a textbox to a class and display on a datagrid
First I would change your class person to use the get and set of the C# public class Pessoa { private string nome; private string endereço; private string ano_nascimento; private string telefone;…
-
0
votes2
answers1046
viewsA: How to Save Date, Time, Minute, and Second in C# WINFORMS and SQL SERVER?
You must use the DateTimePicker in his properties you define that the Format will be Custom and the property CustomFormat you put dd/MM/yyyy HH:mm:ss. If you look in the file Form1.Designer.cs you…
-
0
votes1
answer102
viewsQ: Xamarin Forms with Azure
I am creating an application with integration with Azure, when I try to instantiate the MobileServiceClient I have the following exception Method…
-
0
votes1
answer35
viewsA: Program does not run without reading the contents of the variable
Cauã, what I did to solve your problem was to put a blank space before the %c printf("Digite um dos operadores aritmeticos (+,-,* ou /):\n"); scanf(" %c", &op); For you do not need to use the…
canswered Pablo Tondolo de Vargas 5,444 -
0
votes1
answer145
viewsQ: Comparative Xamarin.Forms Portable or Shared
Mobile development with Xamarin.Forms provides two approaches: Portable: Create a Portable Class Library (PCL) that targets platforms that you want to support and use Interfaces to provide…
-
2
votes3
answers626
viewsA: How to use Lambda expression in List<List<Object>?
Basically what you need is to make a Where in his lstListItNota and making the conditions in Any: lstListItNota.Where(a => a.Any(b => b.Codigo == "A")).ToList();…
c#answered Pablo Tondolo de Vargas 5,444 -
1
votes2
answers750
viewsA: Read a BLOB corresponding to an image
An example I found and worked was first you convert the bytes for a BitmapImage. public BitmapImage BitmapImageFromBytes(byte[] bytes) { BitmapImage image = null; MemoryStream stream = null; try {…
-
2
votes1
answer1846
viewsA: How to use the Contains method in a search using the Entityframework
John, a more practical way to do what you’re trying to do is by using the Any an example would be: var pedidos1 = db.Pedidos .Where(a => !a.Agendamentos.Any()); The SQL generated was the…
-
6
votes2
answers2918
viewsQ: Entity Framework WITH (NOLOCK)
We can use the NOLOCK in the SELECT, thus avoiding the blockages with the commands of INSERT SELECT COUNT(Descricao) FROM Produtos WITH (NOLOCK) Is there any way to use the WITH(NOLOCK) in the…
-
1
votes3
answers554
viewsA: Using the Case When Then command with Entity Framework
One possibility would be to use the conditional operator ?: returns one of two values, depending on the value of a boolean expression. var categorias = context.Categoria. Select(a => new { Codigo…
-
4
votes1
answer75
viewsA: Storyboard Segue
Looks like it’s a bug even from the stable version of Xamarin. I decided to upgrade Xamarin to Alpha version. To update Xamarin, by Visual Studio 2015, to an Alpha version, just go to the menu Tools…