Cheat Sheet for all the formulas in Shigleys engineering designFull description
Postpartum Assessment Sheet
DnD Fifth Edition Cheat Sheet/DM Screen Sheets. contains some valuable rules that can be found quickly on first glance.
Mixing Cheat SheetFull description
electrical cheat sheet for high school and collegeFull description
Full description
Basic outline, plot, and analysis of 1984 by George Orwell.Full description
Full description
All shortcut to learn Optics chapter, its cheat sheet,Descripción completa
Evidence Law cheat sheet for law school students.Full description
boudoir photo guide posing sheet
Lists operating, financing investing and activities.Full description
electrical cheat sheet for high school and college
Descrição completa
electrical cheat sheet for high school and collegeFull description
ECON 002 Penn 2012
A Cheat Sheet for the TAU test in Data Structures.
Visual C# 2005 Express Edition Edition
Cheat Sheet : C# Language Basics Working With Numbers
Define New Types
int = ; // convert from a string int i = int int.Parse( .Parse("1" "1" ; // convert froma string and don’t throw exceptions if (int int.TryParse( .TryParse( "1" "1", , out i)) {} ++; // increment by one --; // decrement by one i += 10; // add 10 i -= 10; // subtract 10 i *= 10; // multiply by 10 = ; // divide by 10 = checked // che ck for overfl ow i = unchecked i*2) // i gnore overflow
Dates and Times DateTime now = DateTime ow; // date and time DateTime o ay = DateTime o ay; // just the date DateTime omorrow = o ay. ays ; DateTime yesterday = today.AddDays(-1); TimeSpan time = tomorrow - today; int days = time.Days; int ours = me. ours ours; ; int m nu es = me. nu es; int seconds = time.Seconds time.Seconds; ; int milliseconds = time.Milliseconds; time += new TimeSpan days, hours, minutes, seconds, m secon s ;
Inheritance
Conditional Logic if == if <= switch (i) { case 0: case : break case : break default: default : break
Working with XML using System.Xml; using ys em. ;
Compare Operators if == // equal if = // not equal if (i <= 0) // less than or equal if (i >= 0) // greater than or equal if > // greater than if < // less than if o is MyClass // check type of object if (o == null // check if reference is null
i++) {} } < ; em in s .
// Crea te an XML fi le using (XmlWriter xw = XmlWriter XmlWriter.Create( .Create(@"c:\names.xml" @"c:\names.xml")) { xw. r e aw "" ; xw. r e aw "Bob" ; xw. r e aw "David" ; xw.WriteRaw("" xw.WriteRaw( "" ; } // Lo ad an XML fi le XmlDocument oc = new XmlDocument ; doc.Load(@"c:\names.xml" doc.Load( @"c:\names.xml"); foreach (XmlNode node in doc.SelectNodes( doc.SelectNodes("//name/text()" "//name/text()" )
string name = "David" "David"; ; string e o = "Hello " name; string e o = string string. . or ma ma "Hello {0}", {0}", na na me me ; Console r e ne "Hello {0}" n am am e ; StringBuilder sb = new StringBuilder "Hello " ; sb.AppendLine(name); sb.AppendFormat( "Goodbye {0}" name); Console r e ne s . o r ng ; // Cre ate a text fi le using StreamWriter w = File File. . rea e ex w. r e ne "Bob" ; w. r e ne "David" ; }
@"c:\names.txt"
// Rea d fro m a text fi le using (StreamReader r = File OpenText( OpenText(@"c:\names.txt" @"c:\names.txt")) )) { while (!r.EndOfStream) { Console r e ne r. r. ea ea ne ; foreach (string s in File ReadAllLines( ReadAllLines(@"c:\names.txt" @"c:\names.txt" ) { Console.WriteLine(s); Console .WriteLine(s);
Working With a Database
class MyClass : Object // override inherited method public override string ToString() { // call base class version string s = base base. . o r ng ng ; return "Hello " } }
else
for (int i=0; i<10; while (i<10) { i++; do ++; while foreach ListItem
struct MyValueType // defi nes a value t ype class MyClass // defi nes a reference type // fields const string co ns ns am e = "LearnVisualStudio.NET"; static string staticName = "LearnVisualStudio.NET"; readonly string rea n y ame; string ns ame; // properties public string ame { // read/write get return ns ame; set ns ame = value; } public string ReadOnlyName { get { return instName; } } // methods public void r n Console. Console . r e ne ns ame ; public int int , int return a + ; public static void PrintStatic() { Console.WriteLine(staticName); Console .WriteLine(staticName); } // constructors public y ass // default constructor public y ass string name { readOnlyName = name; instName = name;
e
using using
ys em. a a; ys em e m. a a. q
en ;
string cs = @"Data Source=.\SQL Source=.\SQLEXPRESS;" EXPRESS;" string cs = @"Initial Catalog=NamesDB;" string cs = @"Integrate @"Integrated d Security=Tru Security=True;" e;"; ; using SqlConnection con = new SqlConnection cs con.Open(); string sql = "INSERT INTO Names(Name) VALUES(@Name)" // insert a record SqlCommand cm = new SqlCommand sq , con ; cm . arame ers. "@Name", "@Name" , SqlDbType SqlDbType. . ar ar, ; cmd1.Parameters[ "@Name" "@Name"].Value ].Value = "Bob" "Bob"; ; cmd1.ExecuteNonQuery(); // insert a second record cm . arame ers "@Name" . a ue = "David" "David"; ; cm . xecu e on uery ; // read records ql = "SELECT * FROM Names"; Names"; SqlCommand cm = new SqlCommand sql, con); using SqlDataReader r = cm . xecu e ea er int ame = r. e r na "Name" ; while (r.Read()) { Console WriteLine( r.IsDBNull(iName)? "Null" r.GetString(iName) ; } // read a single value q = "SELECT TOP 1 Name FROM Names" ; SqlCommand cm = new SqlCommand sq , con ; Console. Console . r e ne cm cm . xe xecu e c a ar ar ;