Design Checklist for Scaling .NET Applications – ADO.NET

Jega's Blog

This is a handy design checklist to check when you are writing a ADO.NET implementation.

ADO.NET

Things to check for when using Connection Object

  • Pool connections.
  • Explicitly close connections.
  • Specify CommandBehavior.CloseConnection if you are using DataReader
  • For single operations of Fill/Update do not open a connection explicitly
  • Avoid checking the State property of OleDbConnection.

Things to check for when using Parameter Object

  • Use Parameters collections when calling stored procedures/building SQL Statements.
  • Use the Parameters collection when you build SQL statements.
  • Explicitly create stored procedure parameters.
  • Specify parameter types.
  • Cache stored procedure SqlParameter objects.

Things to check for when using DataReader Object

  • Always Close DataReader objects.
  • Use CommandBehavior.CloseConnection to close connections.
  • Always Cancel pending data.
  • Use CommandBehavior.SequentialAccess with ExecuteReader.
  • Use GetOrdinal when using an index-based lookup.

Things to check for when using DataSets

  • Reduce serialization.
  • Use primary keys and Rows.Find for indexed searching.
  • Use a DataView for repetitive non-primary key searches.

View original post 103 more words

Add Line Numbers in Code Editor

Tags

, ,

Adding Line numbers to your code can be very helpful when discussing the code with someone else.LineNo_Image7

How to add line numbers to the code: from Tools menu, select Options, and then the Text Editor / C# or Basic options. Select then the “Line numbers” checkbox om the right-side. LineNo_Image7i

Also, it works well with word wrap, you can see when a line starts and ends.
Another way to bring lines to your code is using Macro Explorer Tool window; there is a build in macro built-in that allows to turn on/off the line numbers.

Note: the line numbers are in the code, they are just displayed in a column to the left.

VS.NET Shortcuts

Tags

, ,

Switching between Windows:

Ctrl+F6 – navigate between various panes that appear in the base code editing window.
Shift+Alt+Enter – full-screen mode at any time. In full-screen mode, only the active window is visible in full screen.
Alt+F6/Alt +Shift+F6 – move cursor away from the main editing section into docked windows like Properties, Help, Dynamic help, Server Explorer (if these winows are open).
F7 – Jump to Code Behind/Base Code editing window

Editing:
Ctrl+Shift+V – cycle through the clipboard ring.
Ctrl+- (Ctrl + Hyphen) – similar with Internet Explorer, very easy to navigate from page to page.
Ctrl+Shift+- – cycles in the opposite direction.
Block Selection: – press Alt and then select the area you want with your mouse.
Line No in Code – Tools>Options>Text Editor>All Languages>General>Line numbers.
Ctrl+] :matching brace/comment/region/quote
F4: Property Window
Ctrl+Alt+L – Solution Explorer
Ctrl+Alt+O – Output Window
Ctrl+Alt+K – Task List
Ctrl+Shift+Space – intellisense window.
Ctrl+R – Word Wrap

BookMark:
Ctrl+K, Ctrl+K – Create/Remove Bookmark
Ctrl+K, Ctrl+N – Move to next bookmark
Ctrl+K, Ctrl+P – Move to previous bookmark
Ctrl+K, Ctrl+L – Clear all bookmarks

Code Format:
Ctrl+K, Ctrl+F – Auto-format selection
Ctrl+U – Convert to lower case
Ctrl+Shift+U – Convert to upper case
Ctrl+K, Ctrl+C – Comment selection
Ctrl+K, Ctrl+U – Uncomment selection

Code Outline:
Ctrl+M, Ctrl+M – Fold/Unfold the current code block
Ctrl+M, Ctrl+L – Unfold all
Ctrl+M, Ctrl+P – Stop outlining
Ctrl+M, Ctrl+O – Fold all

Running/Debugging:
F5 – Start Application in debug Mode
Ctrl+F5 – Start Without debugging
F11 – Step into
F10 – Step over.
Shift + F11 – Step Out.
Shift + F5 – Stop debugging.
Ctrl+Shift+F5 – Restart Debugging.

SQL Server Encryption and Decryption Tutorial with Script

Beta Code

SQL Server 2005 and SQL Server 2008 provide encryption as a new feature to protect data against hackers’ attacks. Hackers might be able to penetrate the database or tables, but owing to encryption they would not be able to understand the data or make use of it. Nowadays, it has become imperative to encrypt crucial security-related data while storing in the database as well as during transmission across a network between the client and the server.

Encryption hierarchy is marked by three-level security. These three levels provide different mechanisms for securing data across networks and local servers. Different levels of hierarchies allow multiple instances of services (e.g., SQL Server Services) to run on one physical server.

  • Windows Level – Highest Level – Uses Windows DP API for encryption
  • SQL Server Level – Moderate Level – Uses Services Master Key for encryption
  • Database Level – Lower Level – Uses Database Master…

View original post 1,151 more words

Natural Antibiotics

Terra Nain

NATURAL ANTIBIOTICS

When it comes to antibacterial agents, natural medicine really shines. While there are hundreds of natural antibiotics of varying degrees of strength, here are some of my faves:

1. Oregano Oil—The King of natural antibiotics, study after study proves the effectiveness of oregano oil. Three volumes of research by Paul Belaiche
found that oregano oil killed 96% of all pneumococcus bacteria, 92% of all
neisseria, proteus, and staphylococcus bacteria. Some strains of neisseria are
responsible for diseases like gonorrhea or meningitis. Proteus is a type of
intestinal infection, and staphylococcus is the culprit in some types of food
poisoning. Oregano oil eliminated 83% of streptococcus and 78% of
enterococcus, which are linked with strep throat, scarlet fever, rheumatic
fever, toxic shock syndrome, cystitis, wound infections, and anorexia.

2. Olive Leaf Extract—Olive leaf, like many other natural antibiotics, is also a good antiviral, making it an excellent choice when the nature of the microbe
is not completely known. Drs. O. and B. Lee at the…

View original post 188 more words

Eating Sunday: Inner Wisdom

Michele Thompson

Fish is one of the best things you can eat. But it just isn’t as easy as it used to be.

We know that fish is very good for you, especially your brain and heart, particularly if you are eating oily fish high in omega-3 fatty acids. Unfortunately, we’ve depleted our fisheries to the point where many of the fish we have traditionally enjoyed are no longer sustainable and pollution in our waterbodies has made eating non-toxic fish harder. All of this means that the price of fish has steadily crept higher and higher, making it harder to achieve the eating of more fish. Adding confusion to the mix is the introduction of fish farms. To meet demand at a lower cost, farmed fish has become increasingly popular. Many of these aquaculture operations employ ecological and sustainable practices, but fish farming can be a really dirty business, so you have to be aware of what the farm…

View original post 345 more words

Picture Perfect

Sending you into the weekend with photos of Kathryn Tyler’s stunning home (“Corkellis House” which means “hidden corner) in Cornwall. I cannot imagine a more perfect home.

For a detailed slide show (which is so worth seeing), click here. See also White Wood Grey, Kathryn’s blog.

From the archives: Kathryn Tyler’s design work for the Falmouth House.

Photos by Andrew Meredith for Dwell Magazine

P.S. Don’t miss the Summer issue of Sweet Paul Magazine, which is brilliant, as always.

View original post