Posts by Alexandre Cavaloti • 2,225 points
93 posts
-
0
votes3
answers749
viewsA: Format string for JSON
Create an object to contain json data: string numTel = "998877776"; string textoMSG = "teste teste"; object objMSG = new { from = "InfoSMS", to = numTel, text = textoMSG }; string json =…
-
0
votes1
answer298
viewsQ: Return controller error to JS (Jquery/Ajax)
How to check error on a call return Jquery by ajax for a controller. This return did not come formatted as you would like, just checking the custom fields. $.ajax({ type: "POST", dataType: "json",…
-
0
votes1
answer298
viewsA: Return controller error to JS (Jquery/Ajax)
A Way to send the error to the JS is to update the Status Code of the object response and customize an error msg for return. Controller public JsonResult Create(MyObject myObject) { //Tudo certo…
-
3
votes2
answers67
viewsA: Placing data in the same column (table) HTML5
Try using the same column for the images. There are 3 headers th and there are 5 columns td, reduce to 3 columns td : <html> <head> <link rel="stylesheet"…
-
2
votes1
answer74
viewsA: Query search C# Oledb
Try to put the like as suggested our friend Albert As follows: OleDbCommand cmd = new OleDbCommand("SELECT nomeCadastro FROM TABELA WHERE nomeCadastro like ? ORDER BY nomeCadastro ASC",…
-
4
votes2
answers1771
viewsA: Turn columns into rows
Really, the PIVOT function itself will not have, but it has how to do something similar "in hand". Here is an example of a dynamic query to perform the task: SELECT GROUP_CONCAT( CONCAT( '…
-
2
votes2
answers128
viewsA: Query conditional ordering in Mysql
Create a field that always has the main value. As in the example below and sort by it. Select *, CASE WHEN comentario_pai is null THEN id ELSE comentario_pai END Ordem FROM Comentarios Order By CASE…
-
1
votes2
answers634
viewsA: Boxplots - rstudio
You can use the code below to color the boxes. But you can also use more robust libraries like ggplot or ggplot2. In the example below each box was colored individually, as well as the border. Just…
-
2
votes1
answer647
viewsA: How to insert equal objects or list of objects in Mongodb?
I think what you want to do is include an array of the person object, the way you’ve done it is including a person property/attribute and it’s really only possible to have a property with the same…
-
1
votes1
answer63
viewsA: Crud with Mongodb and C# error in type or namespace
My dear fellow, this may change depending on the version of the mongoDb driver but I always suggest downloading the latest version. The modifications I am going to suggest here were obtained from…
-
1
votes2
answers1043
viewsA: How to use token authentication with Webapi . Net
If authentication is by token, it must be sent in all requests and validated. As much as the existence as the validity of the token, it is a good practice that it has a time to expire. You can use…
-
1
votes2
answers456
viewsA: String Field List Sorting
Hint to solve the problem. Create a weight field/attribute in your minhaNovaEntidade . When adding the new item to the return list put the weight value. After including all classified items, reorder…
-
3
votes2
answers226
viewsA: How to add space in "boxplot" and center the middle
To change the plotting position of the groups use the function position=position_dodge(1) Example: p<-ggplot(ToothGrowth, aes(x=dose, y=len, fill=supp)) + geom_boxplot(position=position_dodge(1))…
-
0
votes1
answer38
viewsA: Doubt Case Sqlserver
Do a conversion treatment for the field as shown below. This way it is possible to guarantee which data exists at the origin of the data. Depending on the results, you can treat the origin of the…
-
0
votes2
answers322
viewsA: Procedure delete Join between tables
Evandro the only problem I saw really serious in your routine is that you don’t have a transaction, IE, if an error occurs in one of the steps, the above will not be undone. I included a transaction…
-
0
votes2
answers52
viewsA: SQL/LINQ vs. Data to feed
Create a temporary table with every month to join. Follow the example: CREATE TABLE #TB_DATAS(Data varchar(10)) INSERT INTO #TB_DATAS (Data) VALUES ('06/2017') INSERT INTO #TB_DATAS (Data) VALUES…
-
1
votes1
answer525
viewsA: What is the difference between INNER JOIN and INTERSECT?
Operations with INTERSECT and EXCEPT are performed based on the implicit conversion of the result between two queries. Operations with INNER JOIN perform a link between two tables or queries through…
sqlanswered Alexandre Cavaloti 2,225 -
0
votes2
answers47
viewsA: Latest records based on a filter
To search for first or last record it is necessary to first order the query. Filter the result and then "take" the return. Note. To search the last records, order the query in descending form.…
-
0
votes1
answer101
viewsA: Convert query to Sqlserver
See if it meets, to get XML data per query in SQL Server: Example of XML: DECLARE @myDoc xml SET @myDoc = '<log expressao="7085"> <par traduzir="N">André Mariano da Silva</par>…
-
1
votes3
answers171
viewsA: Doubt - Update SQL Server 2012
You can do it this way too declare @MesAno varchar(50); set @MesAno = (SELECT DATENAME(MONTH,getdate()) + '-' + Convert(varchar, DATEPART(YEAR,getdate())) as MesAno) UPDATE EstoqueTarefa SET…
-
2
votes1
answer1370
viewsA: Network SQL Database Communication
Enable IP connections In SQL Configuration Manager set up your instance to receive IP connections Enable remote connections In Sql Management Studio right-click on the server, properties,…
-
6
votes2
answers1070
viewsA: Path from previous folder
The following is an example of the use of GetParent() class System.IO.Directory var caminho1 = Directory.GetParent("C:\\Pasta1\\Pasta2"); //caminho1 = "C:\Pasta1"…
-
5
votes3
answers775
viewsA: How can I make a copy of multiple tables in a new table using SQL SERVER?
Using the Union, columns must have the same name and be in the same order. Note: In this case you will not be copying, just joining the result of the selection of several tables. To copy to another…
-
1
votes2
answers917
viewsA: How to reduce the running time of a query in SQL server?
Looking at your routine you can notice some things that impair performance: Fields of the nvarchar type (max) In place of nvarchar(max), determine a field size. This way SQL-Server can better…
-
1
votes3
answers948
viewsA: Logout com Identity
Below is an example of a front-end call: <ul> <li> <a href="~/Login/Logout"> <i class="ace-icon fa fa-power-off"></i> Sair </a> </li> </ul> Follow…
-
3
votes1
answer433
viewsA: Data handling in excel
Here is an example of code to update a spreadsheet in Excel with C# and ADO: var connectionStringBuilder = new System.Data.OleDb.OleDbConnectionStringBuilder(); connectionStringBuilder.DataSource =…
-
0
votes1
answer901
viewsA: Print Argox 0s214T label in vb6
Following example provided by manufacturer using the USB port: Private Sub Command1_Click() 'Test code start ' open port. Dim nLen As Long Dim ret As Long Dim sw As Long Dim nVersion, nMainVersion,…
visual-basic-6answered Alexandre Cavaloti 2,225 -
1
votes2
answers113
viewsA: Join Tables for Tableau
For the 3 tables there is the connection field Pillarid. That is, a hierarchy in 3 levels. But the field of connection between the 3 levels is the same. Then the result will be that same, many rows,…
sql-serveranswered Alexandre Cavaloti 2,225 -
0
votes2
answers626
viewsA: Execute a condition (if/Else) that is inside a string in c# 4.5
If the expression is saved in the database, you can change it to the SQL itself to run the if/else, in case, if SQL Server, change the condition to a case, generate the query dynamically, loading…
-
0
votes1
answer36
viewsA: App UWP connects SQL Server 2012 without Webservice?
If the device connects in the same way as the network BD yes. Otherwise, you will need a service (WCF, REST API etc) to perform the transactions in the BD.
-
2
votes3
answers3932
viewsA: How to remove an item from an array without knowing the index, only the value?
Using indexOf and splice Search the item inside the array and after knowing the index remove the item: var index = meuArray.indexOf("minhaChave"); meuArray.splice(index, 1);…
javascriptanswered Alexandre Cavaloti 2,225 -
1
votes1
answer1942
viewsA: TRANSACTION - How to correct a shipping error?
The Rollback will occur automatically if the connection to the database drops. That is, before running the rollback check if the connection is open, doing so, if the network crash, Rollback will…
-
6
votes3
answers24888
viewsA: Are the accents on my page missing?
It all depends on how the characters are being saved and loaded If instead of Heart, he displays Cora the or Coraã§. In the first case Cora the, your page in ISO-8859-1 is getting the word Heart…
htmlanswered Alexandre Cavaloti 2,225 -
2
votes2
answers74
viewsA: Create a new record based on another with Entity
If the need is to create a new object then what you should do is copy the properties of the base object and not assign the object completely, thus: Market novo = new market(); var objAux =…
-
1
votes2
answers1161
viewsA: How to insert using Sqlbulkcopy with Entityframework
In accordance with the microsoft documentation, if the copy(source) and destination data are in the same instance as SQL Server, it is faster and more efficient to use Transact SQL even, for example…
c#answered Alexandre Cavaloti 2,225 -
0
votes1
answer74
viewsA: Processing of graphical query via javascript
You can filter the results with a higher query SELECT TOP 3 * FROM ( SELECT Title, SUM(Count) AS Count FROM ( SELECT CASE WHEN EstadoId = EstadoIdAutor AND EstadoId = Meddoc1 AND EstadoId = Meddoc2…
-
0
votes1
answer32
viewsA: How to assemble an object?
Would that be? [{ "_id": "59b445edc7e10e11ec8127ec", "palpites": [ { "_id": "59b445bcc7e10e11ec8127e8", "campeonato": "brasil - série a", "casa": "chapecoense", "fora": "avai", "horario":…
mongodbanswered Alexandre Cavaloti 2,225 -
1
votes1
answer51
viewsA: Export a mongodb collection that also brings the document size
Carlos the command that returns the number of records is the db.collection.count()
mongodbanswered Alexandre Cavaloti 2,225 -
0
votes4
answers182
viewsA: Adjustable design for mobile
As far as I can tell, no reference was made to the bootstrap library. Take a look at this documentation and add this reference to the page: <script…
-
1
votes1
answer31
viewsA: Add year to my sql search clause
Include an input parameter @YEAR as INT, and then Filter in the same way you did with the month (Month) but put the variable instead of the fixed values for example like this: (SELECT…
-
2
votes2
answers600
viewsA: How to use Order By before Union in sql Server using this query?
Then see if encompassing everything in another select and including a resolve sorting column: Select * from ( SELECT * FROM ( SELECT distinct 1 as ordem, db_name() as 'Banco_de_Dados',g.KM_SIMBOL,…
sql-serveranswered Alexandre Cavaloti 2,225 -
0
votes3
answers327
viewsA: How to get the variation of the dollar of the website Infomoney?
You can see in the content of the site the following object: $("tbody tr").first().children()[4] It is the first table "body" of the first table, the 5th column, because the index is base 0. Here’s…
phpanswered Alexandre Cavaloti 2,225 -
1
votes2
answers585
viewsA: Jsonresult display Displayname from an Enum
You can create a class to capture the custom attribute of the class property. Here is an example of a custom class and below its usage using System; using System.Collections.Generic; using…
-
1
votes2
answers1553
viewsA: Create plot table dynamically with jquery?
You can use the DOM to include the lines, I think it’s easier and it’s dynamic too. Follow an example: var table = document.getElementById("tbResumo"); var row = table.tBodies[0].insertRow(); var…
jqueryanswered Alexandre Cavaloti 2,225 -
2
votes4
answers702
viewsA: Column 'idusuario' in Where clause is ambiguous
The tables usuario and enderecoUsuario has a column with the name idUsuario specify which table is next to the column name in the where. For example: usuario.idUsuario = idusuario…
-
2
votes1
answer149
viewsA: API to grab image from a search engine
Yes, for example, a good provider for images is Bing. It offers an API, which is paid for, but depending on the use, the cost may be worth it, for example 1000 searches for $3 per month. Follow the…
apianswered Alexandre Cavaloti 2,225 -
2
votes2
answers232
viewsA: How to Suggest Name when Saving Crystal Report
See if this solves, in this export, a class of options is used for the export. In it the property Diskfilename is the file name. ExportOptions CrExportOptions ; DiskFileDestinationOptions…
-
-2
votes3
answers866
viewsA: Entering numerical data in the database
It may be because of commas in your field, which are not identified in the conversion. Try changing the line mo.Valor = float.Parse(txt_valor.Text); for mo.Valor =…
-
1
votes1
answer80
viewsA: Open in certain photo, Slick Carousel
Use the property initialSlide to configure which slide to start. Also note the library documentation: Documentation…
-
1
votes2
answers1129
viewsA: Centralize objects within the div
Centralize DIV by holding positions as 0 (zero) .div { position:absolute; border:1px solid black; margin: auto; top: 0; left: 0; bottom: 0; right: 0; } Centralization of div with bootstrap: <div…