Refactor
:my
=>
'code'
Codes
Refactorings
Popular
Best
Submit
Spam
Account
Logout
Login
JavaScript doesn't seem to be activated, expect things to be ugly and sloppy!
Learn How to Create Your Own Programming Language
createyourproglang.com
Recent
Simple Particle Engine for a shooter game
Snake / Nibbles clone in C and Ncurses
Please improve
Parsing of XML data has high CPU usage
Convert simple Javascript to jQuery plugin
Active Record getting unique records
List the files in a directory without the directory name or the extension
clean the code
ohs system, recruitment software, hr software, oh&s software, human resources software, ohs software
Array parsing in a block
Popular
Parsing of XML data has high CPU usage
Snake / Nibbles clone in C and Ncurses
Please improve
List the files in a directory without the directory name or the extension
Convert simple Javascript to jQuery plugin
Active Record getting unique records
Simple Particle Engine for a shooter game
Breadth first cartesian product iterator
php refactoring
first BST
Pastable version of
Common StProc Code
<pre class='prettyprint' language='cs'>void CopySourceTables(List<TableNameResult> tables, int id) { // Execute the "Copy" Command on the Server for Each Table. using (SqlConnection conn = tgtConnStr_.CreateConnection()) { conn.Open(); using (SqlCommand comm = new SqlCommand("sp_CopySourceTableToTargetTable", conn)) { // create params. SqlParameter source = new SqlParameter("@source", SqlDbType.VarChar, 255); source.Value = srcConnStr_.DatabaseName; comm.Parameters.Add(source); SqlParameter target = new SqlParameter("@target", SqlDbType.VarChar, 255); target.Value = tgtConnStr_.DatabaseName; comm.Parameters.Add(target); SqlParameter schema = new SqlParameter("@schema", SqlDbType.VarChar, 255); comm.Parameters.Add(schema); SqlParameter table = new SqlParameter("@table", SqlDbType.VarChar, 255); comm.Parameters.Add(table); SqlParameter tableID = new SqlParameter("@tableOID", SqlDbType.Int, 0); comm.Parameters.Add(tableID); SqlParameter snapshotID = new SqlParameter("@snapshotID", SqlDbType.Int, 0); comm.Parameters.Add(snapshotID); comm.CommandType = CommandType.StoredProcedure; comm.Prepare(); int tblCount = tables.Count; int currTbl = 0; foreach (TableNameResult tbl in tables) { schema.Value = tbl.User; table.Value = tbl.Table; tableID.Value = tbl.ID; snapshotID.Value = id; RaiseOpProgressEvent(new OpEventArgs("Copying Table Data: '" + table.Value + "'", tblCount, currTbl += 1)); comm.ExecuteNonQuery(); } } } }</pre> <a href="http://www.refactormycode.com/codes/273-common-stproc-code" style="color:#fff" title="As seen on RefactorMyCode.com"><img alt="Small_logo" src="http://www.refactormycode.com/images/small_logo.gif" style="border:0" /></a>