This file contains hidden or 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 connectionString = "Server=192.168.2.56;Database=NEWDB;User Id=SA;Password=123456;"; | |
var conn = new SqlConnection(connectionString); | |
conn.Open(); | |
var tables = new[] { "Categories", "CustomerCustomerDemo", "Employees", "Territories" }; | |
var sb = new StringBuilder(); | |
foreach (var table in tables) | |
{ | |
var ds = new DataSet(); | |
var query = "SELECT * FROM " + table + " "; |
This file contains hidden or 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
SELECT 'public ' + | |
CASE data_type | |
WHEN 'bigint' THEN 'int' | |
-- WHEN 'binary' THEN 'raw' | |
WHEN 'bit' THEN 'int' | |
WHEN 'char' THEN 'char' | |
WHEN 'datetime' THEN 'DateTime' | |
WHEN 'decimal' THEN 'decimal' | |
WHEN 'float' THEN 'float' | |
-- WHEN 'image' THEN 'long raw' |
This file contains hidden or 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
USE SEUDB | |
GO | |
-- Truncate the log by changing the database recovery model to SIMPLE. | |
ALTER DATABASE SEUDB | |
SET RECOVERY SIMPLE; | |
GO | |
-- Shrink the truncated log file to 1 MB. | |
DBCC SHRINKFILE (SEUDB_Log, 1); | |
GO | |
-- Reset the database recovery model. |
This file contains hidden or 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
@ECHO OFF | |
SET DT=%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2% | |
SET TM=%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2% | |
sqlcmd -U sa -P 123456 -S DSK02\SQLEXPRESS -d CAPP2 -Q "backup database CAPP2 to disk='C:\Backup\%DT% %TM%.bak' " |
This file contains hidden or 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
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
SplitTiff(@"c:\temp\0001.tif"); | |
Console.Read(); | |
} | |
public static void SplitTiff(string filepath) | |
{ |
This file contains hidden or 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
using System.IO; | |
namespace CopiaEstrutura | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
string entrada = @"C:\ENTRADA"; | |
string saida = @"C:\SAIDA"; |
This file contains hidden or 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="pt-br"> | |
<head> | |
<title></title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" /> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap-theme.min.css" /> |
This file contains hidden or 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
var files = Directory.EnumerateFiles(txtDiretorio.Text, "*.txt", option); | |
foreach (var file in files) | |
{ | |
var content = File.ReadAllLines(file); | |
File.WriteAllLines(file, content, Encoding.UTF8); | |
} |
This file contains hidden or 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
ALTER DATABASE teste COLLATE SQL_Latin1_General_CP850_CI_AS |
This file contains hidden or 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
public static void MergeFilesPdf(string destinationFile, List<string> fileNames) | |
{ | |
Document document = new Document(); | |
using (var stream = new FileStream(destinationFile, FileMode.Create, FileAccess.Write, FileShare.None)) | |
{ | |
PdfWriter.GetInstance(document, stream); | |
document.Open(); | |
foreach (string strFileName in fileNames) |
OlderNewer