Posts by Rafael Marcos • 599 points
28 posts
-
0
votes2
answers26
viewsA: How do I get the field values?
In this example, we have a string that can be converted into a JSON array. Example of parse: var myJson = { id: "1", genre: "[ {\"id\":\"81\", \"genero\": \"comédia\"} ]" }; var genre = JSON.parse(…
-
0
votes1
answer69
viewsA: Problem with category checkbox and subcategory to display their respective products
Following your Ajax logic, I include in the ajax post all the clicked Ids, separated by comma (","). The following example will not work because we do not have the PHP page working. If you create…
-
0
votes2
answers151
viewsA: How to map an Excel column to a Database column
I believe the easiest way for this case is to use the SQL Server (Sql Server Import and Export Data) data import tool and create a new table in the database temporarily, so that it is possible to…
-
1
votes2
answers75
viewsA: Javascript for Loop - Incomplete and duplicated content
Within the FOR looping, you always used item 0 instead of variable "i" to get HTML from LI. var conteudoLi = conteudoUl.getElementsByTagName("li")[i]; To interact using the variable "i", I had to…
-
-1
votes3
answers1557
viewsA: How to create a popup that keeps blinking on the screen?
A very simple way and open an animated GIF instead of Jpeg. You can create with some apps, or even on some websites. Example: http://www.apptuts.com.br/tutorial/web/sites-para-criar-gifs-animados/…
-
0
votes1
answer836
viewsA: When you click the form 2 button update form 1 label
When you instantiate form 2 when building it (Open the form), you need to pass a reference to the form 1 object (Previous Form), that is to have a form 1 property. So that in form 2 you call a…
-
1
votes1
answer170
viewsQ: Linq to sql with subquery
I have two tables, and would like to get only the data from table A, filtering by related table B. I would like to know how to write this query with Linq to Sql in C#. I wrote the example below in…
-
0
votes4
answers316
viewsA: Is it bad practice to make this comparison?
I believe it’s not a bad practice, just a way to organize and make the code a little easier to understand. If the amount of possibility is too great I would put in a separate object. var listaFoo =…
-
0
votes1
answer145
viewsA: Interop.word service
Maybe it may be a conflict of the site version, using Interop you should run your application as 32bits. Configure in the IIS application pool to run the application as 32 bits. The server must have…
-
1
votes3
answers257
viewsA: Event onclik button in dynamic html Stringbuilder table
I wrote the example of how to write in C#, for learning. Starting the string with@, it is possible to break a line and add quotes with "" html.AppendFormat( @"<td> <button…
-
0
votes1
answer35
viewsA: Concatenate query [MSSQL]
There are several ways, some easier depending on your version of Sql Server. These answers can help you. https://stackoverflow.com/questions/194852/concatenate-many-rows-into-a-single-text-string…
sql-serveranswered Rafael Marcos 599 -
0
votes2
answers1495
viewsA: SQL Server Function - Holidays
Example using the existing Function. ALTER FUNCTION [dbo].[FN_DIA_NAO_TRAB] ( @data SMALLDATETIME ) RETURNS BIT AS BEGIN DECLARE @diaNaoTrab TINYINT DECLARE @flgDataNaoUtil BIT SET @diaNaoTrab= 0 IF…
-
1
votes3
answers842
viewsA: Disable and maintain click
I made an example with DIV’s. $(".divItem").hover( function() { if(! $(this).hasClass("clicked")) $( this ).animate({'width': '120px', 'height':'120px'}, 100); }, function() { if(!…
-
1
votes3
answers708
viewsA: Copy a file from the server to a local folder
Apparently the problem is permission. Even if you don’t have a domain on the server, you can create a local user on each computer, but the name and password must be the same on both computers. After…
c#answered Rafael Marcos 599 -
0
votes2
answers467
viewsA: Onclick Javascript not working with "line break"
When you write in HTML the line breaks should be represented by " n", so you should Replace the line break characters by " n". Example: <html> <body> <input type="button"…
-
0
votes1
answer213
viewsA: How to Integrate a Web Application to Call a C# Biometric Desktop Application
You can move your application up a WCF HTTP service on the local machine and javascript-call on the localhost. For example, you always go up the service in some specific port. Example:…
-
3
votes2
answers89
viewsA: SQL SERVER - Calculus
From what I understand of your question, it would be that answer: SELECT A.ID_Empresa, A.ID_Produto, SUM(CAST(A.Quantidade AS int)) Total FROM Contrato A WHERE A.Registro='Ativo' AND A.ID_Contrato…
-
2
votes2
answers650
viewsA: How to create a javascript array in json format
Example to declare: var myJson = { 'img' : [ 'http://i.vimeocdn.com/video/637696211_200x150.jpg', 'http://i.vimeocdn.com/video/637696227_200x150.jpg',…
javascriptanswered Rafael Marcos 599 -
1
votes3
answers228
viewsA: Doubt Warning in Javascript
window.onbeforeunload = function () { return 'Blá Blá Blá'; } function enviar() { window.onbeforeunload = null; return true; } <form> <input type="text" name="name"> <input…
-
1
votes3
answers136
viewsA: Problems with result accuracy
You are mixing the data types to compare(Int and double). Ideally you would only use decimal or double. Examples: 10 (Int) 10.0 (double) 10m (decimal) double MEDIA_FINAL = (NP1 + NP2) / 2.0; Another…
c#answered Rafael Marcos 599 -
0
votes6
answers2500
viewsA: Hover on DIV1 change DIV2 with CSS
For now it is not possible via css, but you can do this behavior via Javascript as previous examples. You can change the behavior of an element within the same container, or select sub-elements.…
-
1
votes2
answers53
viewsA: js function to hide and show independent Ivs
I’ll explain using javascript with Jquery. By following the logic of this example, you can place any Divs(slides) you want. When calling Function Exibirslide, you must pass the target slide ID:…
-
1
votes1
answer922
viewsA: How to hide button element using CSS only?
It’s likely that your css is in conflict with some other, in this case you can increase the weight of css. For example: div #btnEnviar.btn { display: none !important; }…
-
1
votes2
answers459
viewsA: Javascript concatenated into input name
You can run a javascript code to change the name when loading the page: <form onsubmit="myFunction()"> <input type="hidden" name="_TESTE_AUTO" ID="_TESTE_AUTO" value="1"> <input…
-
0
votes2
answers36
viewsA: My main DIV link does not work if I have a link in my internal DIV
You can’t put a link inside a different link. By HTML specifications existing by W3, you cannot. This restriction has actually been applied by HTML5 browsers.…
-
0
votes2
answers443
viewsA: Paging results in SQL Server 2000
The query below has the same result of the "limit 50, 100", that is brings between the record 51 until the 100. SELECT TOP 50 * FROM tabela WHERE not ID in ( SELECT TOP 50 ID FROM tabela ORDER BY ID…
-
2
votes2
answers2791
viewsA: How to treat a "redirect" after an Ajax call with Jquery?
In my case, when I redirect to the Asp.net login, I add the following header to the login page reply: Response.AddHeader("LOGIN", "LOGIN"); In the Javascript call, I make the following treatment:…
-
21
votes6
answers47964
viewsA: What is JSON? What is it for and how does it work?
JSON is an acronym for "Javascript Object Notation", a lightweight format for computer data exchange. JSON is a subset of Javascript object notation, but its use does not require Javascript…