This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copyToClipboard(){ | |
var textoCopiable = document.body.createTextRange(); | |
textoCopiable.moveToElementText(document.getElementById("toCopyFrom")); | |
textoCopiable.select(); | |
textoCopiable.execCommand("Copy"); | |
textoCopiable.execCommand("unselect"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports System.Data.SqlClient | |
Public Class Form1 | |
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click | |
Using connection As New SqlConnection("Data Source=***SQL-SERVER-LOCATION***;Initial Catalog=***DB-NAME***;Integrated Security=True") | |
connection.Open() | |
Dim command As New SqlCommand("SELECT * FROM ***TABLE-NAME***", connection) | |
Dim reader As SqlDataReader = command.ExecuteReader() | |
While reader.Read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string CS = ConfigurationManager.ConnectionStrings["test_connectionString"].ConnectionString; | |
using (SqlConnection con = new SqlConnection(CS)) | |
{ | |
SqlDataAdapter da = new SqlDataAdapter("testProcedure3", con); // Using a Store Procedure. | |
//SqlDataAdapter da = new SqlDataAdapter("SELECT 'this is a test text' as test", con); To use a hard coded query. | |
da.SelectCommand.CommandType = CommandType.StoredProcedure; // Comment if using hard coded query. | |
DataSet ds = new DataSet(); // Definition: Memory representation of the database. | |
da.SelectCommand.Parameters.AddWithValue("@ggg", 95); // Repeat for each parameter present in the Store Procedure. | |
da.Fill(ds); // Fill the dataset with the query data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Thanks to Enrico Ariel @ http://www.youtube.com/watch?v=Kp4jxrs6uuI | |
//The codebehind: | |
[WebMethod] | |
public static string GetValues(string value) | |
{ | |
value = value +" - Sent @ " + DateTime.UtcNow.ToLongTimeString(); | |
return value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[WebMethod] | |
public static string GetValues2(string value) | |
{ | |
string CS = ConfigurationManager.ConnectionStrings["test_connectionString"].ConnectionString; | |
using (SqlConnection con = new SqlConnection(CS)) | |
{ | |
con.Open(); // The connection needs to be explicitly opened in order to use the SqlDataReader. | |
SqlCommand cmd = new SqlCommand("SELECT * FROM something WHERE somethingId = 2", con); | |
using (SqlDataReader rdr = cmd.ExecuteReader()) // Cannot be instantiated with the 'new' operator. Needs an open connection. | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>$1</title> | |
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="css/styling.css"> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en" ng-app="cosasPorHacer"> | |
<body ng-controller="cosasPorHacer_Ctrl"> | |
<!-- ng-submit se dispara cuando el formulario se envía (bien sea por el accionar de la tecla Enter o por clic sobre el botón "Enviar"); ejecutará "agregarElemento" es el nombre de la función que inserta elementos en el array "$scope.listaDeCosas". --> | |
<form ng-submit="agregarElemento()"> | |
<!-- La propiedad ' ng-model="cosaPorHacer" ' del input hace que Angular pueda tomar su valor desde el controlador. Angular se debe referir a este modelo usando "$scope.cosaPorHacer" --> | |
<input type="text" ng-model="cosaPorHacer" placeholder="Agregar nueva cosa por hacer"> | |
<input type="submit"> | |
</form> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en" ng-app="cosasPorHacer"> | |
<body ng-controller="cosasPorHacer_Ctrl"> | |
<!-- Recuerda usar la librería más reciente disponible (al menos mientras llegue una nueva versión de angular que cambie todo) --> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js"></script> | |
<script> | |
// Declaramos la apliacaión con el nombre 'cosasPorHacer' con un array vacío '[]' y la asociamos a la variable 'aplicacion' | |
var aplicacion = angular.module('cosasPorHacer', []); |